# Recursive call vs while loop

**URL:** <https://discourse.julialang.org/t/recursive-call-vs-while-loop/7723>\
**Category:** Performance\
**Tags:** recursion\
**Created:** [December 12, 2017, 9:37pm UTC](https://discourse.julialang.org/t/recursive-call-vs-while-loop/7723 "2017-12-12T21:37:31Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [April 12, 2022, 8:23pm UTC](https://discourse.julialang.org/t/recursive-call-vs-while-loop/7723/22 "2022-04-12T20:23:01Z")

</div>

Oh sorry, it means: as far as I know.

---

<div class="post-metadata">

**Author:** ![suavesito](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/suavesito/32/34386_2.png) [@suavesito](https://discourse.julialang.org/u/suavesito)\
**Post date:** [April 12, 2022, 9:40pm UTC](https://discourse.julialang.org/t/recursive-call-vs-while-loop/7723/23 "2022-04-12T21:40:12Z")

</div>

> [@ChrisRackauckas](#):
>
> However, LLVM does catch limited cases, and in this simple case Clang++ probably eliminates the call.

I don’t think this is what the OP is getting from. In C++ templates _must_ be resolved at compile time, so with template meta-programming (and now `constexpr` (for expressions, from C++11) and `consteval` (for functions, from C++20)) you get the security and promise that the expression or functions must be resolved at compile time.

(Edit: sorry, didn’t read the date of the post, it just appear in my feed and I jumped in. 😓)

[Previous page](https://discourse.julialang.org/t/recursive-call-vs-while-loop/7723.md?page=1)
