in reply to Re: PerlIO slower than traditional IO?
in thread PerlIO slower than traditional IO?

All true, but coming back to my question: Why would I use something that's both slower and more complicated (read: expensive) to implement?
  • Comment on Re^2: PerlIO slower than traditional IO?

Replies are listed 'Best First'.
Re^3: PerlIO slower than traditional IO?
by eric256 (Parson) on Aug 15, 2005 at 14:13 UTC

    Simple. It isn't more complicated. ;) You gain an easier way to read an MD5 file. The idea that you can decode the file in the open statment is quite nice, because now you can pass that file handle to anything expecting a file handle without those functions needing to worry that it is encrypted. This can be significant, or it can be meaningless. It realy depeneds on your need, if you have a need to gzip or md5 a file that you then want to be able to open and just use the file handle as normal, this is very usefull. If your code is going to look ilke your benchmark then it is 50/50 ;) Thats what makes perl fun, choices.


    ___________
    Eric Hodges

      So I decided to re run your benchmark after making both pieces of code as close to possible as identical. Below are the results and the code, it would appear that it makes no differnce which to choose, both were faster once, and they actualy tied once. I took them tieing on the third run to be a sign ;)


      ___________
      Eric Hodges
Re^3: PerlIO slower than traditional IO?
by CountZero (Bishop) on Aug 15, 2005 at 18:23 UTC
    I don't agree with more complicated. Try to implement each of the filtering layers yourself. Probably each filter will need a totally different approach, whereas the PerlIO are very much the same in use.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re^3: PerlIO slower than traditional IO?
by Anonymous Monk on Aug 15, 2005 at 13:47 UTC
    Good question. So, why do you use Perl, as it's both slower and more complicated to implement than C?