4 ms·
> * There’s no performance benefit to sticking with Fortran. You can make code fast in any language. The main argument that Fortran is faster than C/C++ is to d
by MichaelZuo 4y ago
> * There’s no performance benefit to sticking with Fortran. You can make code fast in any language. The main argument that Fortran is faster than C/C++ is to do with aliasing which anyone writing performance critical code will know how to deal with anyway. Performance portability codes like Kokkos that let you run on OpenMP/MPI/CUDA but write code once are pretty much all C++ too.
Nonsense, any physics PhD student could write meaningful Fortran code over a weekend that's significantly faster then all but the most optimized C code. And even then there might still be a small gap.
It's a huge difference in skill-required effort and hours-spent effort, maybe as high as 100 to 1.
- 11101010001100 4y agoThis was certainly the case while I was a grad student.
- mhh__ 4y ago> any physics PhD student Ignoring that Fortran should be easier for a compiler to optimize than C, this is more of a measure of how much performance "fast" code leaves on the table. You can get very good speedups by just paying attention to the problem, but short of reinventing the universe there's only so much you can do. Ab initio just being a physics PhD doesn't magically give you skills of optimization and (say) knowing how caches work. I know these skills do often come together but in my experience for example every single academic "programmer" I have ever met has been basically lay - fumbling around in the dark, no taste, no idea how the machine works, no idea how to write code that isn't wrong, etc.
- dagss 4y agoThe huge difference is that Fortran defaults to what is in C restrict pointers -- non-overlapping memory regions. This is something most programmers have not even heard about... This means simple Fortran programs have more room for parallelizing optimizing compilers than C programs (without restrict annotations). https://en.m.wikipedia.org/wiki/Restrict https://en.m.wikipedia.org/wiki/Restrict
- KerrAvon 4y agoUtterly bizarre that I've been reading about the pointer aliasing/restrict problems with C since 1993 and the problem hasn't been solved in 20 years.
- noobermin 4y agoThe reason is that it isn't a really a problem for C programs and is infact very desireable for some applications (OSes for example :) )
- noobermin 4y agoThis comment isn't really an argument, it veers close to a complaint about people you've interacted with. To be honest, the vast majority of developers do not know how a cache works.