Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Why is this code so much slower than the same algorithm in C?

by trwww (Priest)
on Dec 09, 2008 at 05:20 UTC ( [id://729090]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why is this code so much slower than the same algorithm in C?
in thread Why is this code so much slower than the same algorithm in C?

Apples to oranges...

Well the script is a constant because all three perl binaries can run it unmodified. Actually, I found 5.6 runs much faster (not surprising, it is a much slimmer app). The top run is using a system provided 5.8, and the second run is a 5.6 install I have for an app I maintain:

$ time /usr/bin/perl test.pl Number: 232792560 real 0m29.042s user 0m29.039s sys 0m0.004s $ time usr/bin/perl test.pl Number: 232792560 real 0m20.968s user 0m20.961s sys 0m0.006s

I ran it a few times and the figures were about the same. But I agree, not really useful. It is a bit interesting though.

Regards,

  • Comment on Re^3: Why is this code so much slower than the same algorithm in C?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://729090]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-16 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found