The "C is Efficient" Language Fallacy
This argument is as old as the hills. It's probably true in a lot of niche situations. But the fact is, most C code is faster than higher-level language code, because:<p>* C programmers have more freedom to arrange data in memory to exploit locality<p>* C data structures need less bookkeeping<p>* C programs manage memory manually, and so lack GC overhead<p>* C programs can easily swap in different allocators for different work sets<p>* C function calls are usually wired into the code, not indirected through (several layers of) tables.<p>That's to say nothing of bytecode interpretation overhead, which is probably a straw-man argument.<p>I buy the instruction scheduling argument for inner-loop numerical and vector scenarios, but even in performant code, that's usually less than 10% of the total, and from what I've seen, both C and HLL code tends to delegate that to machine-specific assembly libraries.