# Identical functions repeated benchmarks show systematic differences

**URL:** <https://discourse.julialang.org/t/identical-functions-repeated-benchmarks-show-systematic-differences/65345>\
**Category:** Performance\
**Tags:** question, sort\
**Created:** [July 27, 2021, 4:08am UTC](https://discourse.julialang.org/t/identical-functions-repeated-benchmarks-show-systematic-differences/65345 "2021-07-27T04:08:27Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [July 31, 2021, 11:25am UTC](https://discourse.julialang.org/t/identical-functions-repeated-benchmarks-show-systematic-differences/65345/28 "2021-07-31T11:25:00Z")

</div>

Having read through this thread again, I’ve noticed that in basically all benchmarks posted here the setup looked something like this:

```julia
list = rand(n)
.
.
.
@benchmark [...] setup=(x=copy(list)) # or deepcopy(list)

```

This will skew the benchmark heavily, since it’s _always the same list that is being sorted_ and the [branch predictor in your CPU will learn the patterns in that data](https://discourse.julialang.org/t/psa-microbenchmarks-remember-branch-history/17436).

I don’t think the benchmarks posted here support the conclusions drawn because of that fact alone (not to mention that they also still don’t account for the code being placed in different memory locations, which may influence things as well). Statistics over statistics are meaningless if the statistics you’ve collected are wonky in the first place.

---

_[View the full topic](https://discourse.julialang.org/t/identical-functions-repeated-benchmarks-show-systematic-differences/65345)._
