# Simple recursive Fibonaci example. How to make it faster?

**URL:** <https://discourse.julialang.org/t/simple-recursive-fibonaci-example-how-to-make-it-faster/32369>\
**Category:** Performance\
**Created:** [December 17, 2019, 2:59am UTC](https://discourse.julialang.org/t/simple-recursive-fibonaci-example-how-to-make-it-faster/32369 "2019-12-17T02:59:46Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [December 18, 2019, 12:20am UTC](https://discourse.julialang.org/t/simple-recursive-fibonaci-example-how-to-make-it-faster/32369/22 "2019-12-18T00:20:54Z")

</div>

> [@StefanKarpinski](#):
>
> Using function calls to express finite automata.

This is a natural generalization of the function barrier + mutate-or-widen approach used in functions like `collect`. So, I think it might be natural to have it in Julia: [Tail-call optimization and function-barrier -based accumulation in loops - #8 by tkf](https://discourse.julialang.org/t/tail-call-optimization-and-function-barrier-based-accumulation-in-loops/25831/8)

---

_[View the full topic](https://discourse.julialang.org/t/simple-recursive-fibonaci-example-how-to-make-it-faster/32369)._
