in reply to PerlIO slower than traditional IO?

I've never had a need to benchmark Perl vs. something else, though I imagine there could be something faster.

However, I think you have to take into account the time needed for development. This is not an insignificant factor, and often outweighs the costs of running more slowly. In the olden days, memory and cycles were quite expensive, so the time spent by programmers to squeeze out a few more bytes or milliseconds was well spent. Now machines are faster, memory is cheap, and the expensive part has become the programmers.

Often it becomes a question of how much it would cost to develop something a bit faster, vs. how much it costs to run a slower program. In many cases, it's much cheaper to have the program take a little more time, than to try to implement it in a more difficult language.

Replies are listed 'Best First'.
Re^2: PerlIO slower than traditional IO?
by saintmike (Vicar) on Aug 15, 2005 at 01:55 UTC
    All true, but coming back to my question: Why would I use something that's both slower and more complicated (read: expensive) to implement?

      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
      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

      Good question. So, why do you use Perl, as it's both slower and more complicated to implement than C?