# Performance difference between two code

**URL:** <https://discourse.julialang.org/t/performance-difference-between-two-code/1557>\
**Category:** New to Julia\
**Created:** [January 18, 2017, 12:12am UTC](https://discourse.julialang.org/t/performance-difference-between-two-code/1557 "2017-01-18T00:12:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![johnmyleswhite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnmyleswhite/32/31_2.png) [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)\
**Post date:** [January 18, 2017, 12:23am UTC](https://discourse.julialang.org/t/performance-difference-between-two-code/1557/2 "2017-01-18T00:23:40Z")

</div>

This might be because indexing allocates memory, but it’s hard to tell for sure since you seem to be benchmarking in the global scope which causes problems.

---

_[View the full topic](https://discourse.julialang.org/t/performance-difference-between-two-code/1557)._
