Robot has asked for the wisdom of the Perl Monks concerning the following question:
Recently, I was shocked to discover that interpreting large perl file was significantly slower on my newer machines (they run fedora core 5+ and centos 5) than my older machines (they run fedora core 2 and core 3).
I am checking the times using "time perl -c <file>" and while the older OSes were doing this for ~1-2 secs (it's a huge CGI script) the newer OSes were parsing it for more than 10 seconds.
The problem is neither in perl version as I checked with both versions I use (5.8.5 and 5.8.8), nor in hardware as I checked with different machines (even vmware ones).
I've tried to do a timed strace but the only thing I was able to discover is that times are generally better on the newer OSes but times between memory segment changes (brk(0x.....) command) were actually causing the problem:
as you can see the system times are fast but the user time are very slow (~ 8-9 seconds waiting till these brk's appear one by one)... brk(0xaebb000) = 0xaebb000 <0.000013> brk(0xaee4000) = 0xaee4000 <0.000018> brk(0xaf0d000) = 0xaf0d000 <0.000018> brk(0xaf03000) = 0xaf03000 <0.000023> brk(0xaf2c000) = 0xaf2c000 <0.000023> ...
Could anyone give me a clue what might be the root of the problems or more hints and ideas of research?
Thank you for you time and efforts!
------ UPDATE (SOLUTION) ------
First, I want to thank to all of the guys here that gave me valuable ideas and tips.
The problem seems to hide in newer glibc working with i386-compiled perl (that's only a humble guess, I would gladly accept any other truthful explanation). I downloaded a new Fedora SRPMS, rebuilt it with i686 target and forcibly installed the newly built RPM over the existing one. Nevertheless that "perl -v" still shows that it's i386 version you should not believe it. Now perl seems to be fast enough (will need a couple more tests but it seems real now)! :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: slow perl script interpretation (syntax check)
by roboticus (Chancellor) on Oct 11, 2007 at 12:41 UTC | |
by Robot (Novice) on Oct 11, 2007 at 13:07 UTC | |
|
Re: slow perl script interpretation (syntax check)
by dave_the_m (Monsignor) on Oct 11, 2007 at 22:50 UTC | |
by Robot (Novice) on Oct 13, 2007 at 21:13 UTC | |
|
Re: slow perl script interpretation (syntax check)
by perlfan (Parson) on Oct 11, 2007 at 18:05 UTC | |
by Robot (Novice) on Oct 13, 2007 at 21:24 UTC | |
|
Re: slow perl script interpretation (syntax check)
by Robot (Novice) on Oct 16, 2007 at 14:43 UTC |