| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is highly optimized implementation of BigInteger on scala for scala, scala-js and scala-native.
You can use it as
libraryDependencies += "pt.kcry" %%% "biginteger" % "x.x.x"
As the base it is used scala-js implementation that was ported from java by Alistair Johnson that is technically GWT/Harmony/IBM JDK implementation.
All this optimization mainly focused to less sweepings and highest performance on mod, modPow and isProbablePrime. As side effect I've optimized divide, remainder, nextProbablePrime and something near.
Summary of optimizations:
The key idea of montgomery function is splitting it to modSquare and modProp where each of them is merged version of multiplication and reduction that used constant sweepings.
This fork also fixed bugs:
For compare performance I've included to benchmarks BigInteger implementation from OpenJDK 14, but I haven't used any part of inside the code.
Benchmarks:
All benchmarks was performed on JDK 14.0.1, Java HotSpot(TM) 64-Bit Server VM, 14.0.1+7 at Intel® Core™ i7-8700B.
Short summary:
Full version also available as jmh-result.json or via JMH Visualizer.
| Back | FazBrowse Home | New Git URL |