Considering Big Numbers. <@UGB1USA2J> made some be...
# mathematics
a
Considering Big Numbers. @Iaroslav Postovalov made some benchmarks for kmath BigInt implemented by Robert Drynkin and @Peter Klimai, JDK BigInt and https://github.com/ionspin/kotlin-multiplatform-bignum by @Ugi. It seems that our implementation is even a bit faster than JDK and much faster (two times) than the one by @Ugi. I intended to drop our implementation in favor of extenral library, but now it does not make sense to do that. Kmath relies on a tiny fraction of BigInt functionality and we do not intend to support the whole spectrum of fetures, so I am not sure what to do next. Should we maintain two separate multiplatform bigint implementations (one for special features and one for Algebra compatibility or try to improve @Ugi implementation?
The benchmarks are here: https://github.com/mipt-npm/kmath/tree/bignums/examples/src/benchmarks/kotlin/scientifik/kmath/bignum and you can ask @Iaroslav Postovalov for results.
u
Hey @altavir sorry for not responding to this earlier, I was on vacation. For now I would keep them separate, there is still a lot of room for improvement on my side and I'll keep working on it, and if at some point I get to the same speed as kmath BigInt implementation, we can reconsider the situation again. The slowness on my side might be also coming from the design choice of using 63bit for limb size, although I have a competing 32bit limb implementation that is more or less up to date in regards to functionality to the main implementation. I need to bring it up to 100% and then compare the results. Also I need to look into optimizing division, if I recall my last profiling it was rather slow.
a
@Ugi OK. We will keep our implementation for now. It is quite easy to maintain several context for the same numbers in kmath.
👍 1