From: Dan Sugalski Date: 2003-04-03T23:10:00+09:00 Subject: Re: Newbie question:read file speed At 7:35 AM +0900 4/3/03, Brian Candler wrote: >Out of interest, I also ported your code to Perl (attached), and also >modified the Ruby code to use a more iterative style to be closer to Perl. I >get: > > (to screen) (to /dev/null) >Perl (5.005_03) 3.9 secs 2.3 secs >Ruby (1.6.8) 6.5 secs 3.6 secs > >So it seems that Perl is significantly faster in this simple test, but also >the block/yield approach does not by itself add a great deal of overhead >(fortunately!) Be aware that perl cheats unmercifully at IO, to the extent of peeking beneath the C IO library hood and acting directly on the underlying buffer structure. While somewhat evil (okay, it's very evil) it does cut out at least one level of function calls for IO, and speeds things up some. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk