5 ms·
That’s because C and Fortran also continue to benefit from all the compiler research?
by atty 4y ago
That’s because C and Fortran also continue to benefit from all the compiler research?
- 082349872349872 4y agoIt's (mostly) because C and Fortran continue to benefit from all the hardware research.
- tgflynn 4y agoSo if you ran benchmarks compiled using the best C compiler from 2004 compared against the best current C compiler on 2004 era hardware you'd see a factor of 2 performance gain ? That's possible, I suppose, but I doubt it.
- yakubin 4y agoCurrent compiler optimisations are written with current hardware in mind, while I doubt that older optimisations would become pessimisations on newer hardware, so I'd compare the performance of the best C compiler from 2004 against the performance of the current best C compiler on today's hardware instead.
- kragen 4y agoI have seen that kind of thing happen, yeah. I used to use dumb Fibonacci as an easy microbenchmark for getting a rough idea of language implementation efficiency: __attribute__((fastcall)) int fib(int n) { return n < 2 ? 1 : fib(n-1) + fib(n-2); } main(int c, char **v) { printf("%d\n", fib(atoi(v[1]))); } This gives a crude idea of the performance of some basic functionality: arithmetic, (recursive) function calls, conditionals, comparison. But on recent versions of GCC it totally stopped working because GCC unrolls the recursive loop several levels deep, doing constant propagation through the near-leaves, yielding more than an order of magnitude speedup. It still prints the same number, but it's no longer a useful microbenchmark; its speed is just determined by how deeply the unrolling happens. It's unusual to see such big improvements on real programs, and more recent research has shown that Proebsting's flippant "law" was too optimistic.
- guerrilla 4y agoTurn off optimizations and find out.
- tgflynn 4y agoCompiler optimizations existed 18 years ago.