[kaffe] Re: [freenet-dev] Freenet slowness dominated by Sun's slow implementation of modPow()?

Matthew Toseland toad@amphibian.dyndns.org
Sat Mar 15 01:43:01 2003


--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Further testing shows that this is purely an artifact of our thread
use/system load... when run outside Fred, Sun takes about 20ms to do
a modPow(), and Kaffe takes about 2ms. Under light load, Sun can take
200ms or so; under relatively heavy load, Sun takes 900-1400ms. This
would appear to be mainly caused by our excessive usage of threads and
its interaction with the kernel scheduler...

[CC'd to kaffe@kaffe.org because of borderline relevance, due to the
figures on kaffe vs sun modPow()]

On Sat, Mar 15, 2003 at 03:07:27AM +0000, Matthew Toseland wrote:
> It looks like the dominating factor in the crypto in authorizeTime is
> BigInteger.modPow() (a JVM-provided method, which really ought to be
> fast...). I'm seeing an average time for modPow() of 1412ms (it seems to
> be increasing...). With Sun 1.4.
>=20
> Now, with Kaffe, which uses libgmp, averages are closer to 59ms-75ms.
>=20
> I will run it on Kaffe overnight to see what happens.
>=20
> Possibilities:
>=20
> A) Fix remaining Kaffe problems (kaffe has monolithic GC, causing
> longish delays from time to time which lock the whole VM, but there is a
> kaffe derivative that uses Boehm incremental GC which could be merged;
> kaffe seems to get longer lock times suggesting maybe its locking is very
> heavy...), bundle Kaffe with Freenet (even on the Win32 version - this
> should be possible, I believe there is a port). Grumble if running a Sun
> JVM, but still run.
>=20
> B) Call out to an external, platform specific helper app if available
> (grumble loudly if it isn't there). With times of a second or more, this
> is probably still faster than using Sun's slow code.
>=20
> C) Any other suggestions?
>=20
> We really should do something about this is 0.5.2 - shaving 900ms off
> average authorizeTime's/connectingTime's is not something to be ignored.
>=20
> BTW, the theory: Kaffe uses libgmp, which is very very fast. Sun uses
> some apparently badly written in-house BigInteger code.
> --=20
> Matthew Toseland
> toad@amphibian.dyndns.org/amphibian@users.sourceforge.net
> Full time freenet hacker.
> http://freenetproject.org/
> Freenet Distribution Node (temporary) at http://80-192-4-36.cable.ubr09.n=
a.blueyonder.co.uk:8889/J3Q~LkZ7ezk/
> ICTHUS.



--=20
Matthew Toseland
toad@amphibian.dyndns.org/amphibian@users.sourceforge.net
Full time freenet hacker.
http://freenetproject.org/
Freenet Distribution Node (temporary) at http://80-192-4-36.cable.ubr09.na.=
blueyonder.co.uk:8889/nDBm5SExzKo/
ICTHUS.

--FCuugMFkClbJLl1L
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+cvYTmlVGrEH/+qIRAuEpAJsFRfqryteRwfoaLVAK7ExH3uH8tQCfRSdm
uXBNQ/LqAVg9MlyIkHd8KrQ=
=ACCK
-----END PGP SIGNATURE-----

--FCuugMFkClbJLl1L--