V
vfoley
Hello everyone,
I wrote a little script in Perl to make stats on a log file. You can
view the source at: http://pastebin.ca/104391 . When running on an
OpenBSD 3.9 machine (Pentium III 450 MHz, 128 MB RAM), with Perl 5.8.6,
the script takes 35 seconds to crunch through a file with 175,000
lines. Not bad. However, a Ruby script (http://pastebin.ca/104393)
that I wrote a while ago does the same file in 23 seconds. As far as I
know, the Perl interpreter is faster than Ruby, so I would be
interested to know how I could improve the execution speed of the Perl
script. I'm still very new, so I don't know all the idioms and such,
so any help would be greatly appreciated.
Also, when I profiled the Perl script, dprofpp's time percentages only
added up to like 5 or 10%. Why is that? Where is the remaining 90%?
Regards,
Vincent
I wrote a little script in Perl to make stats on a log file. You can
view the source at: http://pastebin.ca/104391 . When running on an
OpenBSD 3.9 machine (Pentium III 450 MHz, 128 MB RAM), with Perl 5.8.6,
the script takes 35 seconds to crunch through a file with 175,000
lines. Not bad. However, a Ruby script (http://pastebin.ca/104393)
that I wrote a while ago does the same file in 23 seconds. As far as I
know, the Perl interpreter is faster than Ruby, so I would be
interested to know how I could improve the execution speed of the Perl
script. I'm still very new, so I don't know all the idioms and such,
so any help would be greatly appreciated.
Also, when I profiled the Perl script, dprofpp's time percentages only
added up to like 5 or 10%. Why is that? Where is the remaining 90%?
Regards,
Vincent