benefits of GNU BigInteger (from GNU classpath): - we don't need to maintain jbigi - we don't need to maintain jcpuid - jcpuid's per-cpu speed improvements are probably negligible anyway; the bigger speed increase is java->native, not native->native-special-for-your-cpu - GNU BigInteger is much faster than our jbigi implementation
(we don't need to depend on the entirety of GNU classpath, we can just include the bits we need: https://bitbucket.org/dfdeshom/gmp-java) # on latest fred-staging: # assumes you are on debian, with gcj-4.6-jre-lib installed: $ git checkout bigint-gnu-gmp $ ant unit -Dtest.class=net.i2p.util.NativeBigIntegerTest -Dtest.benchmark=true [...] unit: [junit] Running net.i2p.util.NativeBigIntegerTest [junit] Testsuite: net.i2p.util.NativeBigIntegerTest [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 26.878 sec [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 26.878 sec [junit] ------------- Standard Output --------------- [junit] DEBUG: Warming up the random number generator... [junit] DEBUG: Random number generator warmed up [junit] INFO: 200 runs complete without any errors [junit] native run time: 4121ms (20ms each) [junit] java run time: 8465ms (42ms each) [junit] gnu run time: 1776ms (8ms each) [junit] native = 48.682811577082106% of pure java time [junit] gnu = 20.98050797401063% of pure java time [junit] DEBUG: Warming up the random number generator... [junit] DEBUG: Random number generator warmed up [junit] INFO: 200 runs complete without any errors [junit] native run time: 6254ms (31ms each) [junit] java run time: 3987ms (19ms each) [junit] gnu run time: 2190ms (10ms each) [junit] native = 156.85979433157763% of pure java time [junit] gnu = 54.92851768246802% of pure java time [junit] ------------- ---------------- --------------- [junit] ------------- Standard Error ----------------- [junit] INFO: Optimized native BigInteger library 'net/i2p/util/libjbigi-linux-x86_64.so' loaded from resource [junit] ------------- ---------------- --------------- [junit] [junit] Testcase: testModPow took 14.436 sec [junit] Testcase: testDoubleValue took 12.438 sec [...] -- GPG: 4096R/5FBBDBCE https://github.com/infinity0 https://bitbucket.org/infinity0 https://launchpad.net/~infinity0 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 900 bytes Desc: OpenPGP digital signature URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20110727/645c98c5/attachment.pgp>