Top
Best
New

Posted by d_tr 2 days ago

Making Julia as Fast as C++ (2019)(flow.byu.edu)
16 points | 5 comments
FattiMei 3 minutes ago|
Very interesting post and I think this exposes the limitations of the Julia compiler. Note that an old version of the compiler is used (1.0.3 from 2019).

One could say that we can almost replicate the semantic of a C++ program, but writing in Julia. For example we can remove bounds checks in arrays or remove hidden memory allocations.

But the goal of a language for numerical computing is capturing the mathematical formulas using high level constructs closer to the original representation while compiling to efficient code.

Domain scientists want to play with the math and the formulas, not doing common subexpression elimination in their programs. Just curious to see how it evolves

StilesCrisis 21 minutes ago||
Punchline: rewrote the code to look almost identical to C++, hand-held the compiler by adding @-marks to disable safety checks, forced SIMD codegen and fastmath on.

End result: code that is uglier and still much slower than C++. Kind of a shame.

brabel 2 minutes ago|
> code that is uglier and still much slower than C++.

Oh such a shame indeed! They didn’t even manage to produce better looking code at least?? Julia was looking great in 2019 but it was very buggy still so I stopped looking. Had hopes that by now it would be a good choice over C++ and Rust with similar performance.

ForceBru 1 hour ago||
Recent discussion on Julia Discourse: https://discourse.julialang.org/t/making-julia-as-fast-as-c/
slwvx 2 days ago||
From 2019