On the efficiency of scripts

Consider datatrans1.py: read 100 000 (x,y) data from a pure text (ASCII) file and write (x,f(y)) out again

Pure Python: 4s
Pure Perl: 3s
Pure Tcl: 11s
Pure C (fscanf/fprintf): 1s
Pure C++ (iostream): 3.6s
Pure C++ (buffered streams): 2.5s
Numerical Python modules: 2.2s (!)
(Computer: IBM X30, 1.2 GHz, 512 Mb RAM, Linux, gcc 3.3)

previousnexttable of contents