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. :)
In reply to Re: perl printf vs C fprintf performance
by brian_d_foy
in thread perl printf vs C fprintf performance
by decnartne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |