# Getting non-vectorized code to the speed of vectorized ones

**URL:** <https://discourse.julialang.org/t/getting-non-vectorized-code-to-the-speed-of-vectorized-ones/71525>\
**Category:** Numerics\
**Tags:** question\
**Created:** [November 15, 2021, 8:31pm UTC](https://discourse.julialang.org/t/getting-non-vectorized-code-to-the-speed-of-vectorized-ones/71525 "2021-11-15T20:31:20Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 18, 2021, 8:19pm UTC](https://discourse.julialang.org/t/getting-non-vectorized-code-to-the-speed-of-vectorized-ones/71525/21 "2021-11-18T20:19:36Z")

</div>

@DNF, assuming this is correct, perhaps your ideas on this subject would merit a place in the [performance tips](https://docs.julialang.org/en/v1/manual/performance-tips/) section?

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 18, 2021, 8:34pm UTC](https://discourse.julialang.org/t/getting-non-vectorized-code-to-the-speed-of-vectorized-ones/71525/22 "2021-11-18T20:34:46Z")

</div>

It’s not really an _idea_, as such. There are people on this board who _know_ about this. I’m just reporting my understanding of things I’ve read.

I think this, anyway, is a micro-optimization, perhaps too marginal for the performance tips.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 18, 2021, 8:42pm UTC](https://discourse.julialang.org/t/getting-non-vectorized-code-to-the-speed-of-vectorized-ones/71525/23 "2021-11-18T20:42:48Z")

</div>

> [@DNF](#):
>
> micro-optimization

Tested again with @benchmark and the median speedups were sytematically of the order of ~20%. This is not a micro saving, and the idea behind, if correct, should be highlighted.

[Previous page](https://discourse.julialang.org/t/getting-non-vectorized-code-to-the-speed-of-vectorized-ones/71525.md?page=1)
