News for hackers. Stuff that matters.
Re:“CPUs are optimized for video games” by flamedoge on Thursday August 11, 2016 @04:20AM (#12266853)
and I'm sure pure Fortran would be even faster
Re:“CPUs are optimized for video games” by alfalfasprout on Thursday August 11, 2016 @05:46PM (#12271815)
Eh, doubtful. Sure, it'll be faster than unoptimized C. But when you observe strict aliasing rules in C a modern compiler will generally produce similar quality assembly for both languages. The reason BLAS is so fast is that every single line of code in a hot loop has been hand-optimized and tons of CPU-specific optimizations exist

Fortran yields some of the fastest code out of the box, yes, but C/C++ can yield equivalent performance by adhering to certain basic rules.

Re:“CPUs are optimized for video games” by flamedoge on Monday August 15, 2016 @02:17AM (#12288980)
Even with strict aliasing, the only way C/C++ standard effectively lets one type to be cast to another is incurring a copy. Tell me what can be done better for performance in C that can't be done in Fortran or "another static language without pointer indirection".
Re:“CPUs are optimized for video games” by eru on Thursday August 11, 2016 @05:50AM (#12267055)
That's mostly because of Fortran doesn't have the same aliasing trouble as C?
Re:“CPUs are optimized for video games” by flamedoge on Monday August 15, 2016 @02:18AM (#12288981)
Pointer indirection is expensive tradeoff for flexibility