Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The issue with optimizability in C is mostly solved by the C99 `restrict` keyword

I've seen people claim this, but I've yet to see optimizing compilers for C actually match those for Fortran.



In practical terms: what kind of performance difference would one see between optimized C(++) and optimized Fortran when running exactly the same algorithm?


According to the Julia benchmarks (and I assume Julia folks are relatively unbiased re: C vs Fortran), it depends on the algorithm [1], but less than an order of magnitude in either direction. I'm kinda surprised Fortran doesn't do better there actually -- but at this level it probably also depends on compiler and architecture.

[1] https://julialang.org/benchmarks/





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: