in reply to perl printf vs C fprintf performance

You're not simply timing the print statements, but also the perl overhead (which gets less and less significant the larger your program gets) as well as the compilation time (which can continue to be significant).

To be fair to perl, you'd have to also add in the time to compile your C program and whatever else you have to do to make it an executable.

Still, you should never be surprised that C is faster than perl. :)

--
brian d foy <bdfoy@cpan.org>
  • Comment on Re: perl printf vs C fprintf performance

Replies are listed 'Best First'.
Re^2: perl printf vs C fprintf performance
by decnartne (Beadle) on Mar 14, 2005 at 20:11 UTC
    ...understood. I guess, I'm just surprised that C was *that* much faster in this instance.

    The replacement script fairs pretty well processing all of the records from the DB, etc. However, I am just a little curious how printf vs fprintf differ enough for a ~6 second difference...

    decnartne ~ entranced