2 ms·
Maybe, this person should understand what they are timing. The time command is a wonderful tool, but comparing the execution time of a 4 line C program with the
by jerven 12y ago
Maybe, this person should understand what they are timing.
The time command is a wonderful tool, but comparing the execution time of a 4 line C program with the start up cost of a VM and interpreter is inane.
One needs to measure the program doing the real work. And in this case for the C program you might find that bash forking is the actual cost not the C code running through the loop.
JRuby and PyPy are starting to do things with their specialisation tricks that mean that the overhead of abstraction is 1000 loops before it goes away.
A performance benchmark running for less than a few minutes is a joke. Startup variance alone will dominate the results.
- Chris911 12y agoExcept he's not comparing the C program and the Python one. He's comparing the time difference (or ratio) for each language with and without abstraction.
- haberman 12y ago> comparing the execution time of a 4 line C program with the start up cost of a VM and interpreter is inane. That's not what I compared. Maybe you should read the article again? > And in this case for the C program you might find that bash forking is the actual cost not the C code running through the loop. I didn't publish any benchmark numbers of any C programs, because I didn't need to: the two C++ programs I was comparing compiled to exactly the same machine code, making empirical observations of their execution time immaterial.