Performance comparison, Julia is a slower than Mojo, am I doing something wrong?

To answer the question directly, no @Brian1, you are not doing anything incorrect. Run-time recursion in julia is not something that’s designed to be used in performance sensitive scenarios, and is instead optimized for different things.

It’s not particularly surprising that another language is faster than Julia at doing this. But this also isn’t a very big deal because any algorithm you want to write which makes use of recursion in this way can be rewritten in more performance friendly ways which we do expect Julia to perform well at.

8 Likes