# 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:** 4

<div class="post-metadata">

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

</div>

On the other hand

```julia
@tullio a[i] = b[i,j]*c[j]

```

is incredibly fast and easy to understand for one line of code 😉 ([see the thread](https://discourse.julialang.org/t/simple-mat-vec-multiply-understanding-performance-without-the-bugs/44762))

Mostly don’t write loops, let macros do that for you!

---

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