From: Dan Sugalski Date: 2003-04-04T03:54:38+09:00 Subject: Re: Newbie question:read file speed At 1:04 AM +0900 4/4/03, Daniel Berger wrote: >Dan Sugalski wrote: >> > >> 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 > >This must be the vaunted Perl IO layer that I've seen mentioned from >time to time. Nope. That's more a Tcl/SysV style streams thing, and is relatively new. This is old code, and has been in perl for years. > Any reason Ruby couldn't "cheat" as well? Anything Ruby >can borrow here? Sure, license willing. (And I'm pretty sure it is, but I'd double-check with Larry and Matz first) The code's in sv.c, in the Perl_sv_gets function, though there's a fair amount of gook and macro expansion you may have to do to actually make sense of it. The code's in there, though. Evil, definitely evil, but it is there. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk