# Improving an algorithm that compute gps distances

**URL:** <https://discourse.julialang.org/t/improving-an-algorithm-that-compute-gps-distances/38213>\
**Category:** Performance\
**Tags:** tullio\
**Created:** [April 26, 2020, 12:46am UTC](https://discourse.julialang.org/t/improving-an-algorithm-that-compute-gps-distances/38213 "2020-04-26T00:46:03Z")\
**Posts on this page:** 2\
**Page:** 3

<div class="post-metadata">

**Author:** ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)\
**Post date:** [April 27, 2020, 10:14am UTC](https://discourse.julialang.org/t/improving-an-algorithm-that-compute-gps-distances/38213/42 "2020-04-27T10:14:37Z")

</div>

Good point. After pulling that out, `distances_cast_avx` is down to 113ms, but `distances_threaded_simd` is hardly changed, and `distances_tullio` not at all. I think LoopVectorization is happy to re-order loops and to pull such functions out of them, and I guess it succeeded.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [April 27, 2020, 10:20am UTC](https://discourse.julialang.org/t/improving-an-algorithm-that-compute-gps-distances/38213/43 "2020-04-27T10:20:34Z")

</div>

If LoopVec realizes that that’s a really nice feature 🙂 I wonder if it’s guaranteed though, because if it fails it can be a massive loss.

[Previous page](https://discourse.julialang.org/t/improving-an-algorithm-that-compute-gps-distances/38213.md?page=2)
