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

I did some Julia benchmarking over the weekend against a bunch of languages if anyone is interested. The workload is an EKF on an Apple M1, I'm trying to do as many as possible in parallel:

https://raw.githubusercontent.com/mech-lang/mech/codex/taich...

Compared against Taichi, Halide, Futhark, Rust', Lua, LuaJIT, Numpy and pure scalar Python. Julia holds up great it can run basically as fast as you'd like! (These are not apples-to-apples comparisons, picture this as a basket of fruit)

'The Mech results should be understood to be a lower bound on how Rust would perform.

 help



I'd like to see how Mojo performs here

https://raw.githubusercontent.com/mech-lang/mech/codex/pypy-...

I added PyPy and Mojo.

PyPy performs valiantly compared to Cpython -- even better than LuaJIT. I'm sure someone skilled at writing it could do an even better job.

I measured 3 Mojo implementations. The first is a dynamic implementation, it performs like a typical dynamic language. Then when you use Mojo's SIMD intrinsics you can get compiled-tier performance in line with Futhark, Julia, Rust etc.

Then if you use their Max toolchain you can compile Mojo directly to Metal, with performance at the top of the stack (for the amount of money Qualcomm paid they'd better be there!).

The Rust / Mech version was rewritten to put it back on top, but the unchecked test is about equal. Basically if a toolchain can emit direct Metal code there's nothing preventing equal performance it seems, so the magic is in the compiler. Although there is some abstraction overhead depending on how you get there e.g. going wgpu->Metal has a penalty over going directly to Metal.

The big disclaimer again is that all of these measurements should be taken as lower bounds for one algorithm on one machine. I'm sure expert performance engineers could do better.


Nice. Suggestion: Add PyPy too.

Done, see reply to sibling.



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

Search: