-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Moin,
On Sunday 27 May 2007 14:43:15 Tels wrote:
> Moin,
>
> a patch to update Math::BigInt::FastCalc in blead to v0.15. Noteworthy
> changes:
>
> * alias the _nok() method so that Bnok() can use it through Calc
> * add _new() to the XS code, making ->new() faster. For small numbers
> it is about 10% faster, and up to 25% for large/huge numbers. This
> speedup is visible in Math::BigInt, btw, not just deep down in the
> lower level library. See attached benchmark.
>
> One issue that came to light is that a seemingly simple operation as:
>
> use Math::BigFloat;
> $x = Math::BigFloat->new('0.008'); $y = Math::BigFloat->new(2);
> $x->bdiv(3,$y);
>
> causes 27 calls to _new() inside Calc/FastCalc. This suggests some
> complicated operations inside BigFloat/BigInt, which should be
> investigated, sowe can minimize the calls.
Even stranger is that when running under Calc (e.g. not FastCalc) it becomes
49 calls. The reason is that somewhere along the way $scale becomes a
BigInt object, which then gets stored as a part of a BigFloat - this
shouldn't even happen and I am surprised it actually works. (The reason it
works is probably because BigInt's overload magic is sufficiently
transparent enough that things just get slower, but don't blowup).
Still investigating the problem (which is somewhere inside BigInt or
BigFloat).
Tels
- --
Signed on Sun May 27 15:26:38 2007 with key 0x93B84C15.
Get one of my photo posters: http://bloodgate.com/posters
PGP key on http://bloodgate.com/tels.asc or per email.
"One man in a thousand is a leader of men, the other 999 follow women"
-- Groucho Marx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iQEVAwUBRlmjMHcLPEOTuEwVAQKeTAf/VPPKo+ZypphTrc1kU6hlLDCmEB9nPpRp
aTqYU9hYWlGrQr0/J6ZWC4PVkq9/QtiMQCfGG8ULenCwQF+qw9nr5aFb2F4Cc4ks
pk8J5N43AXw8WTt6dRko2WbzXw6v+tHp+4eej21sIYbGUOHkKkNsWcJJxEdTeOBm
WhRHhWEWDvSD1NxqMKT3DBTYPsS8sfXJ7Z/1AZOkXl4RzqogTgxHSItMhDPTaloO
PFzu4rkWmWqI5nAc1jK2o4x+VX565msO2zpeo2IhlHrt133MUbJ12HjTmellgJ4N
yEX0sVkYiQrJjH/3ibEVLBJKyCPTvQplLvxgl/BaURDjnRsmu1RPww==
=9zf4
-----END PGP SIGNATURE-----
Thread Previous
|
Thread Next