# Can the julia compiler optimize code for the processor cache?

**URL:** https://discourse.julialang.org/t/can-the-julia-compiler-optimize-code-for-the-processor-cache/36392
**Category:** Maker
**Tags:** question
**Created:** [March 23, 2020, 2:11pm UTC](https://discourse.julialang.org/t/can-the-julia-compiler-optimize-code-for-the-processor-cache/36392 "2020-03-23T14:11:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![andrey2185](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrey2185/32/9889_2.png) [@andrey2185](https://discourse.julialang.org/u/andrey2185)
#### Post date: [March 23, 2020, 2:11pm UTC](https://discourse.julialang.org/t/can-the-julia-compiler-optimize-code-for-the-processor-cache/36392/1 "2020-03-23T14:11:19Z")

</div>

can the julia compiler optimize code for the processor cache?

---

<div class="post-metadata">

### Author: ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)
#### Post date: [March 23, 2020, 4:18pm UTC](https://discourse.julialang.org/t/can-the-julia-compiler-optimize-code-for-the-processor-cache/36392/2 "2020-03-23T16:18:44Z")

</div>

Most likely, not explicitly. I guess that is LLVM territory. This looks like a dangerous and too low level feature to worry in a language such as julia…  
There may be some package or code pattern that handles this…

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [March 23, 2020, 5:38pm UTC](https://discourse.julialang.org/t/can-the-julia-compiler-optimize-code-for-the-processor-cache/36392/3 "2020-03-23T17:38:38Z")

</div>

The package LoopVectorization does this in some specific cases (mainly loop re-ordering). There are currently some discussions about how Julia could do some of this itself.
