On Tue Nov 22 09:13:21 2005, guest wrote:
Show quoted text> Consider this hypothetical situation.
> Both Math::BigInt::Pari and Math::BigIt::GMP are installed,
> and I have a program like
>
> use Math::BigInt lib => 'PARI';
> use Crypt::DSA::KeyChain;
>
> Since
http://search.cpan.org/dist/Crypt-DSA/lib/Crypt/DSA/KeyChain.pm
> uses
> use Math::BigInt lib => 'GMP';
>
> Both GMP and PARI would be loaded into memory,
> but only one would be used.
>
> The easy way to avoid this is to not install both
> Math::BigInt::Pari and Math::BigIt::GMP,
> but the situation can come up.
>
> Soo, you might warn about this??
> Or modify sub import to accept lib => only once?
That would be an option, I have to think about it. Note that there is no
harmin loading both, except a tiny bit of memory overhead:
No lib loaded (results in FastCalc loaded):
(In Kbytes)
Virt Res Shared
6648 4112 1464 S 0.0 0.4 0:00.08 perl
Calc loaded (pure-perl):
6332 3804 1404 S 0.0 0.4 0:00.06 perl
GMP loaded:
6156 3504 1476 S 0.0 0.3 0:00.05 perl
(Yes, it actually needs less memory :)
Pari loaded:
12952 4748 1788 S 0.0 0.5 0:00.08 perl
Both loaded:
13300 4840 1820 S 0.0 0.5 0:00.07 perl
So, Pari needs loads of memory, while GMP uses the least amount. It is
also the fastes of the libs for large numbers.
Loading both needs much more memory as loading none or even loading GMP,
but the memory-hog is Pari, not GMP :)
Best wishes,
Tels