[Melbourne-pm] and the winner is C! (so far anyway, no big surprise)

Sam Watkins sam at nipl.net
Sun May 23 16:23:40 PDT 2010


On Fri, May 21, 2010 at 07:21:16PM +1000, Toby Corkindale wrote:
> curiously, I've made the Perl version use buffered IO and it seems to be  
> (very very slightly) slower than the original, not faster! How odd.

Perl uses buffered IO by default.  It doesn't seem to make that much difference
though:

$ ./read.pl data.csv >/dev/null
Code took 2.16798 wallclock secs ( 2.14 usr +  0.01 sys =  2.15 CPU) @  0.47/s (n=1)

$ ./read-unbuf.pl data.csv >/dev/null
Code took 2.43998 wallclock secs ( 2.28 usr +  0.14 sys =  2.42 CPU) @  0.41/s (n=1)

That one had a $|=1 in it, so it does a write after each line output.


Sam


More information about the Melbourne-pm mailing list