3 ms·
Like you observe, the compilers matter. Historically, C compilers just couldn't do such a good job at optimising, because C is pretty complex and has loads of
by guitarbill 10y ago
Like you observe, the compilers matter.
Historically, C compilers just couldn't do such a good job at optimising, because C is pretty complex and has loads of undefined behaviour. Also, Fortran compilers have always been optimised for numerical computation.
Recently * , a lot of effort has gone into making C compilers produce very optimised code. In general, this is a good idea because humans are bad at optimising and also remembering every damned Intel vectorisation instruction.
So historically, Fortran was much faster, recently * with compiler advances in e.g. reordering and AMD64, it's possible C compilers beat Fortran compilers.
* edit: adjust your definition of recently to encompass the entire timeframe of Fortran's existance
- flamedoge 10y agoCompilers are afraid to optimize around possible UB, even though they can.
- greglindahl 10y agoHaving worked with key people from the SGI compiler team, and then competed with Intel / PGI / Sun / gcc on x86, I totally disagree.
- flamedoge 10y agoI guess I should've looked when I said "Compilers". I only skimmed two and one of them is LLVM.
- flamedoge 10y agoI totally see UB as a blessing in disguise for optimizer.
- greglindahl 10y agoUsually, yeah. The art is making it debuggable, when the user accidentally strays into UB and needs help not doing that.