6 ms·
> which I'm pretty sure beats both Julia and Mojo Sometimes "showing the code" is not enough. Show me the benchmark.
by TwentyPosts 3y ago
> which I'm pretty sure beats both Julia and Mojo
Sometimes "showing the code" is not enough. Show me the benchmark.
- bjourne 3y agoI'll pass - Hacker News comments are not dissertations. The C code ran faster on my machine. YMMV.
- dahart 3y agoIf you want speed, why not use, say, GLSL, instead of C? The code is far simpler, and runs much faster than C.
- nindalf 3y agoRan faster on your machine than what? Mojo was only runnable locally starting 2 days ago, so it doesn't sound like you compared it with Mojo.
- DNF2 3y agoI don't really believe you ran either the Mojo or the Julia code. There's no way your single-threaded C code outperformed multi-threaded simd optimized Julia or Mojo. It's flat out impossible. The only other explanation is if you ran the non-simd Julia version under a single thread.
- bjourne 3y agoI ran this Julia code which one of the thread participants claimed to be the "best": https://discourse.julialang.org/t/julia-mojo-mandelbrot-benchmark/103638/25 https://discourse.julialang.org/t/julia-mojo-mandelbrot-benc... Run your own benchmarks if you don't believe me. IDGAF.
- sundarurfriend 3y agoJust to make sure, did you start Julia with multithreading enabled? `julia --threads=auto` should do it (or `julia -tauto` if you prefer). Without it, Julia starts single threaded, which means the code does all this work to enable multithreading and then doesn't get to benefit from it.
- bjourne 3y agoI did. Running with threads improves performance by 50%, but is still nowhere near C performance. My machine only has two cores so threading doesn't help much.
- sundarurfriend 3y agoThat's interesting. It makes sense that a two core machine doesn't benefit too much from multithreading, but "nowhere near C performance" is pretty surprising. I'll try out both the programs around this weekend on my own fairly anaemic machine, and see how they fair for me. Thanks for responding!
- bjourne 3y agoCool. If Julia runs much faster for you than for me I'd be interested in hearing it. I was honestly surprised the performance was so bad so perhaps I did something wrong.