Home > Archive > PERL Miscellaneous > July 2005 > Perl performance issue
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Perl performance issue
|
|
| Cameron McCormack 2005-07-27, 9:03 am |
| Hi everyone.
I am migrating my web/mail/svn/etc. servers from a computer connected to
my ADSL at home, an old Athlon 800, to a hosted Celeron 2.4GHz machine.
I found though that Perl runs much more slowly on the new machine and I
really don't know why. The problem seems to show itself mostly when
loading modules (though this could just be because there is lots of
code in the modules).
For example on my old machine:
jet:~ $ for x in . . .; do time perl -MCPAN -e1; done
real 0m0.167s
user 0m0.158s
sys 0m0.008s
real 0m0.166s
user 0m0.156s
sys 0m0.009s
real 0m0.167s
user 0m0.159s
sys 0m0.007s
and on the new machine:
arc:~ $ for x in . . .; do time perl -MCPAN -e1; done
real 0m2.310s
user 0m2.280s
sys 0m0.030s
real 0m2.320s
user 0m2.270s
sys 0m0.050s
real 0m2.326s
user 0m2.300s
sys 0m0.030s
Actually, even without loading the CPAN module there is an appreciable
difference:
port:~ $ for x in . . .; do time perl -e1; done
real 0m0.009s
user 0m0.004s
sys 0m0.005s
real 0m0.010s
user 0m0.004s
sys 0m0.006s
real 0m0.009s
user 0m0.005s
sys 0m0.003s
arc:/tmp $ for x in . . .; do time perl -e1; done
real 0m0.069s
user 0m0.060s
sys 0m0.000s
real 0m0.067s
user 0m0.060s
sys 0m0.000s
real 0m0.069s
user 0m0.060s
sys 0m0.010s
I did multiple tests to (hopefully) discount issues of disk speed. Both
machines are using the same Debian package versions (5.8.7-4).
Anyone know why this might be (with the little information I've given)
or be able to help me diagnose the problem properly?
Also, if there's a more appropriate forum for this question, please
point me towards it.
Thanks,
Cameron
--
e-mail : cam (at) mcc.id.au icq : 26955922
web : http://mcc.id.au/ msn : cam-msn (at) aka.mcc.id.au
office : +61399055779 jabber : heycam (at) jabber.org
| |
| brian d foy 2005-07-27, 5:05 pm |
| In article <42e76687$1@quokka.wn.com.au>, Cameron McCormack wrote:
> Hi everyone.
>
> I am migrating my web/mail/svn/etc. servers from a computer connected to
> my ADSL at home, an old Athlon 800, to a hosted Celeron 2.4GHz machine.
> I found though that Perl runs much more slowly on the new machine and I
> really don't know why.
Compare the two perl binary (perl -V) and see what's different
about them. :)
--
brian d foy, bdfoy@cpan.org
Subscribe to The Perl Review: http://www.theperlreview.com
| |
| Cameron McCormack 2005-07-27, 10:01 pm |
| brian d foy wrote:
> Compare the two perl binary (perl -V) and see what's different
> about them. :)
I did compare the output of 'perl -V' on both machines, and the only
difference was that on my old machine there are a couple of extra paths
in @INC.
--
e-mail : cam (at) mcc.id.au icq : 26955922
web : http://mcc.id.au/ msn : cam-msn (at) aka.mcc.id.au
office : +61399055779 jabber : heycam (at) jabber.org
| |
| Christian Winter 2005-07-28, 4:01 am |
| Cameron McCormack schrieb:
> Hi everyone.
>
> I am migrating my web/mail/svn/etc. servers from a computer connected to
> my ADSL at home, an old Athlon 800, to a hosted Celeron 2.4GHz machine.
> I found though that Perl runs much more slowly on the new machine and I
> really don't know why. The problem seems to show itself mostly when
> loading modules (though this could just be because there is lots of
> code in the modules).
Did you check other programs than perl too? It could very
well be an issue of the system configuration (like missing
kernel optimisations). You should perhaps also check with
"top" if there are processor time consuming tasks running
in the background.
If it's indeed only perl that runs slowly, you could run
"strace -fFv -o SOMEFILE.txt perl -e1" and compare the
output (SOMEFILE.txt) on both machines whether there are
some obvious problems on the new machine that don't appear
on the old one.
There are quite a number of possible causes, even hardware
errors. Most of them should show their signs in the event
log or when doing an strace.
HTH
-Chris
|
|
|
|
|