# Function definition inside let-block impacting performance?

**URL:** https://discourse.julialang.org/t/function-definition-inside-let-block-impacting-performance/110007
**Category:** Performance
**Tags:** question
**Created:** [February 9, 2024, 8:06pm UTC](https://discourse.julialang.org/t/function-definition-inside-let-block-impacting-performance/110007 "2024-02-09T20:06:28Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)
#### Post date: [February 9, 2024, 9:34pm UTC](https://discourse.julialang.org/t/function-definition-inside-let-block-impacting-performance/110007/7 "2024-02-09T21:34:26Z")

</div>

I think this could be a variation of the problem in this recent thread

> [@Different result of \`===\` between \`@runtest\` and REPL](https://discourse.julialang.org/t/different-result-of-between-runtest-and-repl/108924/5):
>
> Actually I changed my mind and now think this is intended. From [the manual on scopes](https://docs.julialang.org/en/v1/manual/variables-and-scoping/#local-scope) (emphasis mine): A new local scope is introduced by most code blocks (see above [table](https://docs.julialang.org/en/v1/manual/variables-and-scoping/#man-scope-table) for a complete list). If such a block is syntactically nested inside of another local scope, the scope it creates is nested inside of all the local scopes that it appears within, which are all ultimately nested inside of the global scope of the module in which the code is evaluated. \*\*Variables in outer scopes are visible fro…

But I am too tired to see how the connection is exactly.

---

_[View the full topic](https://discourse.julialang.org/t/function-definition-inside-let-block-impacting-performance/110007)._
