Skip Menu |

This queue is for tickets about the Math-BigInt CPAN distribution.

Report information
The Basics
Id: 27881
Status: open
Worked: 5 min
Priority: 0/
Queue: Math-BigInt

People
Owner: TELS [...] cpan.org
Requestors: nmartynov [...] swsoft.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.87
Fixed in: (no value)



Subject: Loss of time cause BigInt can't work fast with mod_perl
Date: Mon, 2 Jul 2007 17:04:50 +0400
To: bug-Math-BigInt-GMP [...] rt.cpan.org
From: Nikolay Martynov <nmartynov [...] swsoft.com>
Hello, TELS! Its seems that under mod_perl environment the multiplication of two integer tooks to much time, while under console all ok Console: elapsed: 0.174578 Mod_perl: elapsed: 31.216795 We using mod_perl-1.29, perl-Math-BigInt-GMP-1.18, gmp-4.1.4-7 Installing new module's does not solve this problem Test script -------os2ip.pl------------------------------- use Time::HiRes qw( gettimeofday tv_interval ); use Math::BigInt lib => 'GMP'; my $os = 'MIIBugIBAAKBgQDVF9Wp+VzCcaw6wtbFKAEEW6vAndJwGP3IsoTDkx0DB9ZcAJ5A JUSn7iR8M5oaNX5npipP9EcLHHtg3M1HqcXcpN195R3z/QsZd79VC2AHBQIVAL2A mUoNCuTw/LMejIwDpag00hUp4Ga1y8Cy63QVIfheZ3i6AxKcC/YWD6YEpPEtH/sY v6HQn2EI/s8v2tb2ad8Dg6t3AoGAeZXp1MqkJllFNl6hAK2dACsIaGAKEeMuuyJG CROApAIcbc3JX06vjGATm+vyPn8wAQHOcrThzkFp0tqrzJjCA5wuUi4WwG0pPX32 DjkRYA4CgYBW2r4nFIirl+MOHCJMtonMmS9slMcGLrCkIuBIMxSPR9w7Jx+OnU9D DIOnq53hq0fAQVNROKt7CQN3LxhLBNBa9GmQpDwrKg6PMI1k94tnCsmxhcieNvbX h9PaqYuw+r/Ko22BU6OdYzhjl8d3rMyzXNZWoJZMOT77Mmb6NiVKDRDrUHHtHkwD 0HgPLlya6LkinokQbc3L9LCh0FqKU2En4AIdgHIiSeEpqcZIH8p7dgIUMQ7ZLtXF 1p1zsF3KZUDZU8NIiz0'; my $base = Math::BigInt->new(256); my $result = Math::BigInt->new(0); my $neg = ord($os) >= 0x80 and $os ^= chr(255) x length($os); my $t0 = [gettimeofday]; for (unpack("C*",$os)) { $result = ($result * $base) + $_; } $elapsed = tv_interval ( $t0, [gettimeofday]); print "elapsed: $elapsed\n"; -------os2ip.pl------------------------------- -- Best regards, Nikolay mailto:nmartynov@swsoft.com SWsoft, Inc. www.swsoft.com
Subject: Re: [rt.cpan.org #27881] Loss of time cause BigInt can't work fast with mod_perl
Date: Mon, 2 Jul 2007 18:47:26 +0200
To: bug-Math-BigInt-GMP [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, On Monday 02 July 2007 15:03:37 Nikolay Martynov via RT wrote: Show quoted text
> Mon Jul 02 09:03:36 2007: Request 27881 was acted upon. > Transaction: Ticket created by nmartynov@swsoft.com > Queue: Math-BigInt-GMP > Subject: Loss of time cause BigInt can't work fast with mod_perl > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: nmartynov@swsoft.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=27881 > > > > Hello, TELS! > > Its seems that under mod_perl environment the multiplication of two > integer tooks to much time, while under console all ok > > Console: elapsed: 0.174578 > Mod_perl: elapsed: 31.216795 > > We using mod_perl-1.29, perl-Math-BigInt-GMP-1.18, gmp-4.1.4-7 > Installing new module's does not solve this problem
As I do not have mod_perl and no experience using it, I am at a loss how to find out whats taking so much time. What is the difference between mod_perl and console? Could it be because Math-BigInt-GMP uses free/malloc? How long does it take without using "lib => 'GMP'"? All the best, Tels - -- Signed on Mon Jul 2 18:44:58 2007 with key 0x93B84C15. View my photo gallery: http://bloodgate.com/photos PGP key on http://bloodgate.com/tels.asc or per email. "Blogebrity: Wow, guess what this one stands for? Too easy. Hey, anyone can do it: take a blogger who's a chef, and you get: BLEF. A blogger who's a dentist? BENTIST. A female blogger with an itch? You guessed it: a BITCH." -- maddox from xmission -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iQEVAwUBRoksLncLPEOTuEwVAQK/uwf8CGhxVmVzDexCNKOeFJNHfsfmcRVoW1vu bB7Jl+17F3IcdPn+NIvxMhqDd1RINhfO+PPqFiVV6G/AnAWh288hRq4D6h7EDhHD 1WBNl2Cr1fr0BHsauG7rtsJisd8VJlF4EOTQ9SdUtwiDd0/hV3EDDAPwSU0wXmT/ wPEy5PGly3EhRF97XMFL6ZpHjwucfazAlHdv595qDhMMaz/oFLCUaxQDmcaQjgTk 4JnOGWZTFMDyqJ3X65zMwpOa+OUENWeh7uoV53haaus5qFmG7AsykJXW0L86M3bW gqWSpF8Z/muouXQty+pLUBOZKEFNAtJx20LJRZXuFc+wOSAVGepLyQ== =8spv -----END PGP SIGNATURE-----
Subject: Re[2]: [rt.cpan.org #27881] Loss of time cause BigInt can't work fast with mod_perl
Date: Tue, 3 Jul 2007 16:00:45 +0400
To: bug-Math-BigInt-GMP [...] rt.cpan.org
From: Nikolay Martynov <nmartynov [...] swsoft.com>
I'm sorry, this bug seems to be for Math::BigInt module It tooks the same time even with Math::BigInt::Calc Can you readress this bug? Thank you for help Show quoted text
nabcvR> Could it be because Math-BigInt-GMP uses free/malloc? How long does it take nabcvR> without using "lib => 'GMP'"?
-- Best regards, Nikolay SWsoft, Inc. www.swsoft.com
Subject: Re[3]: [rt.cpan.org #27881] Loss of time cause BigInt can't work fast with mod_perl
Date: Tue, 3 Jul 2007 16:09:10 +0400
To: bug-Math-BigInt-GMP [...] rt.cpan.org
From: Nikolay Martynov <nmartynov [...] swsoft.com>
Or even better, please, just delete this ticket I'll do some additional research Thank you! Show quoted text
nabcvR>> without using "lib => 'GMP'"?
-- Best regards, Nikolay SWsoft, Inc. www.swsoft.com
Subject: Re: [rt.cpan.org #27881] Loss of time cause BigInt can't work fast with mod_perl
Date: Tue, 3 Jul 2007 18:45:55 +0200
To: bug-Math-BigInt-GMP [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Moin, On Tuesday 03 July 2007 14:07:54 Nikolay Martynov via RT wrote: Show quoted text
> Queue: Math-BigInt-GMP > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=27881 > > > Or even better, please, just delete this ticket > I'll do some additional research > Thank you!
I have moved the ticket to Math::BigInt since I am still interested in knowing what causes this difference. Please copy the rt queue on anything you find! All the best, Tels - -- Signed on Tue Jul 3 18:45:17 2007 with key 0x93B84C15. View my photo gallery: http://bloodgate.com/photos PGP key on http://bloodgate.com/tels.asc or per email. "Schau, schau, Schoschonen." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iQEVAwUBRop9THcLPEOTuEwVAQId4gf+O8/+IIIvdhtGgfT7bSdjwMDg1OkDV0rM Rpi8/iW6rCU5QvqrmMqY1ec4HPqLl/7qCPNeGccAMT3JFUA/+SsB7EATsp/RBO1b fghMpJ5V98we00IU7boOoB9qNkKbrh4r0EerZ8sILA8dbX+dZKGY4G9CNVC4TXek 3E9JGy7wBT22H4sfPnIZ1zqI7uLi+PrwbSHRMHrFY2sQb9XtnTW+3m3Cmh1LQSke GtJwBxvdzVFAzB3d8rzUxtEbJHsu2XfO1H0ZhsF/XdeflF7IjbJK2jGyDtArG17u lu0LVpVQegf1ixwiNwK0XV5M/KLLL5zee/7+gwj+TcB61KClZNsF4Q== =nAvM -----END PGP SIGNATURE-----
Subject: Re[4]: [rt.cpan.org #27881] Loss of time cause BigInt can't work fast with mod_perl
Date: Wed, 4 Jul 2007 13:12:07 +0400
To: bug-Math-BigInt [...] rt.cpan.org
From: Nikolay Martynov <nmartynov [...] swsoft.com>
Hello Tels! I think we found the slowness reason - its because our %INC contains about 2020 records! (huge number of loaded modules, but its true). Maybe its not a very good idea to use objects guessing in such low-level operations, like multiply or addition of integers? Let we look to Math::BigInt::objectify function: with 50 records in %INC it took about 0.00027 secs per call with 1100 records 0.009185 secs with 1532 records it tooks 0.013851 secs and so on.. Show quoted text
nabcvR> I have moved the ticket to Math::BigInt since I am still interested in nabcvR> knowing what causes this difference.
-- Best regards, Nikolay SWsoft, Inc. www.swsoft.com
On Wed Jul 04 05:11:14 2007, nmartynov@swsoft.com wrote: Show quoted text
> Hello Tels! > > I think we found the slowness reason - its because our %INC contains > about 2020 records! (huge number of loaded modules, but its true). > > Maybe its not a very good idea to use objects guessing in such > low-level operations, like multiply or addition of integers? > > Let we look to Math::BigInt::objectify function: > > with 50 records in %INC it took about 0.00027 secs per call > with 1100 records 0.009185 secs > with 1532 records it tooks 0.013851 secs > and so on..
Maybe it's not a good idea to have 2000 records in %INC. Every module call is going to physically look through all 2000 directories to find that module. Can we close this ticket?