# How to speed up this function?

**URL:** <https://discuss.ocaml.org/t/how-to-speed-up-this-function/10286>\
**Category:** Learning\
**Created:** [August 10, 2022, 1:46am UTC](https://discuss.ocaml.org/t/how-to-speed-up-this-function/10286 "2022-08-10T01:46:17Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [August 10, 2022, 5:56pm UTC](https://discuss.ocaml.org/t/how-to-speed-up-this-function/10286/9 "2022-08-10T17:56:09Z")

</div>

> [@gasche](#):
>
> short version: Not currently, no. It may be in the future.

Putting aside the more general occurence (which is known to me, floats gets boxed when they cross functions) I’m still a bit surprised by the result here.

My intuition would have been: this function is going to be turned into a loop by the compiler (which an `(fib1[@tailcall])` annotation can confirm) and that means the floats are going to be locally unboxed.

But as far as my rusty assembly goes that doesn’t seem to be [the case](https://godbolt.org/z/E6sszhssf) (at least on 4.12).

---

_[View the full topic](https://discuss.ocaml.org/t/how-to-speed-up-this-function/10286)._
