# Why are loops not slow in Julia?

**URL:** https://discourse.julialang.org/t/why-are-loops-not-slow-in-julia/63205
**Category:** New to Julia
**Tags:** question
**Created:** [June 19, 2021, 10:33pm UTC](https://discourse.julialang.org/t/why-are-loops-not-slow-in-julia/63205 "2021-06-19T22:33:28Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [June 20, 2021, 2:26am UTC](https://discourse.julialang.org/t/why-are-loops-not-slow-in-julia/63205/7 "2021-06-20T02:26:28Z")

</div>

Previously:

> [@Why Are Languages Like Python and MATLAB So Much Slower than Julia?](https://discourse.julialang.org/t/why-are-languages-like-python-and-matlab-so-much-slower-than-julia/51381/9):
>
> The simplest answer is that, naively, higher level dynamic languages need to ask meta-questions about everything in order to figure out what to do. That is, given a function like: function mysum(array) r = zero(eltype(array)) for elt in array r += elt end return r end A traditional high-level language doesn’t know what elt will be — and it might not always be the same thing. So in every single iteration the language needs to ask: what type is elt? what type is r? wh…

---

_[View the full topic](https://discourse.julialang.org/t/why-are-loops-not-slow-in-julia/63205)._
