Perl is faster then python!
code source: http://www.amk.ca/files/simple/celsius
Ported to perl by me! Python (hate it): Code:
import sys,string Code:
use POSIX; Results (Test#1): Code:
debian:~# time perl celsius.pl 25 Code:
debian:~# time python celsius.py 3 Code:
print "hello world"; #works in python and perl! Code:
debian:~# time perl test.py |
Sorry to spoil your day, but those time intervals are way too small to be accurate. Besides, I am not really impressed by the difference between 0.063s and 0.064s for the Perl and Python version. Let the programs run 10.000 times and measure that time and report back.
jlinkels |
I ran it 500 times!
perl: Code:
real 0m0.577s Code:
real 0m0.790s |
Quote:
Anyway, the main difference between Perl and Python is not speed, but features. |
Quote:
|
I was also curious as to which version of Perl and Python?
I ask as it may also be necessary to test with Python 3.X (not sure if it would make any difference) to have a fuller picture. |
perl is faster than python 'cause you can type it with only four keystrokes.
|
I did some benchmarks for a fisher yates shuffle,
slurp a file into an array and shuffle it. for randomizing mp3 files for a USB stick. Not biased cos I wanted to learn ruby, but was dismayed how slow it was. RUBY $ time ./fisher_yates.rb < don_quixote.txt > 1 0.35s real 0.28s user 0.06s system PYTHON $ time ./fisher_yates.py < don_quixote.txt > 1 0.24s real 0.22s user 0.01s system PERL $ time ./fisher_yates.pl < don_quixote.txt > 1 0.13s real 0.10s user 0.01s system But of course C++ knocks 'em for six but takes much more programming time C++ $ time ./fisheryates < don_quixote.txt > 1 0.06s real 0.04s user 0.01s system |
Quote:
Quote:
What is the purpose of this thread? |
Quote:
|
All times are GMT -5. The time now is 12:15 AM. |