23 ms·
> 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" co
by 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.