Re:The overhead of abstraction in C/C++ vs. Python/Ruby
by haberman on Saturday October 18, 2014 @05:27PM
(#8476377)
> 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.
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.