# Why \`Mojo\` can be so fast?

**URL:** <https://discourse.julialang.org/t/why-mojo-can-be-so-fast/98458>\
**Category:** Offtopic\
**Tags:** mojo\
**Created:** [May 8, 2023, 5:34am UTC](https://discourse.julialang.org/t/why-mojo-can-be-so-fast/98458 "2023-05-08T05:34:08Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 8, 2023, 8:21am UTC](https://discourse.julialang.org/t/why-mojo-can-be-so-fast/98458/6 "2023-05-08T08:21:39Z")

</div>

10-loc benchmarks are the silliest game in town, but if someone insists, here is what I think is the fastest Julia version:

> [@Simple recursive Fibonaci example. How to make it faster?](https://discourse.julialang.org/t/simple-recursive-fibonaci-example-how-to-make-it-faster/32369/15):
>
> As noted above, it is probably TCO and/or unrolling. We can also do all kinds of tricks, eg function fibval(::Val{N}) where N if N ≤ 1 1 else fibval(Val{N - 1}()) + fibval(Val{N - 2}()) end end julia\> @time fibval(Val(46)) # first run, includes complilation time 0.057667 seconds (166.50 k allocations: 9.972 MiB, 22.78% gc time) julia\> @time fibval(Val(46)) # let's benchmark Base.show 0.000182 seconds (4 allocations: 160 bytes) These things are fun, but they t…

Compilation is even faster in 1.9 😛

With respect, I think that questions about the internals and design of Mojo should be asked on the Mojo forum (if there is one, didn’t check).

---

_[View the full topic](https://discourse.julialang.org/t/why-mojo-can-be-so-fast/98458)._
