Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

acme (189)

  (email not shown publicly)

Leon Brocard (aka acme) is an orange-loving Perl eurohacker with many varied contributions to the Perl community, including the GraphViz module on the CPAN. YAPC::Europe was all his fault. He is still looking for a Perl Monger group he can start which begins with the letter 'D'.

Journal of acme (189)

Monday August 25, 2008
11:05 AM


[ #37268 ]

I was microoptimising. I admit it. I was trying to get a little bit of code which read a part of a file going quickly, and I got slightly sidetracked. I noticed that PerlIO had layers, so I played around with the layers and benchmarked things. I noticed that :stdio was quite fast for my one test case, so I compiled a new Perl with ./Configure -des -Uuseperlio -Dprefix=/home/acme/perl-5.10.0-stdio/ to ignore PerlIO and use stdio instead, then benchmarked things (didn't really help). I eventually thought about using unbuffered IO, and noticed that it was much faster than all the others. Aha! I suddenly remember about buffered and unbuffered IO. Buffered IO using seek, read, and write is very handy when reading or writing the whole file. If you are actually doing random access in files then you should use sysseek, sysread and syswrite, doh!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.