# Why would a fast computer run Julia slower than a slow computer?

**URL:** <https://discourse.julialang.org/t/why-would-a-fast-computer-run-julia-slower-than-a-slow-computer/5999>\
**Category:** General Usage\
**Created:** [September 20, 2017, 1:46pm UTC](https://discourse.julialang.org/t/why-would-a-fast-computer-run-julia-slower-than-a-slow-computer/5999 "2017-09-20T13:46:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![evanfields](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evanfields/32/1744_2.png) [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Post date:** [September 20, 2017, 1:46pm UTC](https://discourse.julialang.org/t/why-would-a-fast-computer-run-julia-slower-than-a-slow-computer/5999/1 "2017-09-20T13:46:21Z")

</div>

I have two computers, both running Julia v0.6 on Windows 10 x64:

- My **laptop** is just shy of 4 years old. It has an intel i5-2400u @ 1.6GHz, 2 cores, 4 threads. With Geekbench, its single-core CPU score is 2985.
- My **desktop** was most recently upgraded two months ago. It has a Ryzen 5 1600X @ 3.6Ghz, 6 cores, 12 threads. With Geekbench, its single-core CPU score is 4178.

However, single-threaded Julia runs faster on the laptop. For example, here are the results of running the following code on both computers:

```julia
BLAS.set_num_threads(1)
x = [peakflops(parallel = false) for _ in 1:30]
mean(x), extrema(x)

```

**Laptop** `(2.82e10, (2.49e10, 2.89e10))`  
**Desktop** `(1.63e10, (1.53e10, 1.68e10))`  
So the more modern desktop, which we would expect from the Geekbench scores to be about 40% faster, is barely half as fast as the laptop.

And this isn’t just a BLAS difference between the computers either. I first noticed this issue when timing some simulations which are written in pure Julia. These simulations don’t involve any linear algebra; it’s all random number generation, manipulating DateTime objects, sorting and shuffling lists, dictionary lookup, etc. Even so, the older laptop runs these simulations almost twice as fast as the modern desktop.

Any thoughts on why this might be or more principled ways to do an apples-to-apples comparison between the computers?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [September 20, 2017, 1:59pm UTC](https://discourse.julialang.org/t/why-would-a-fast-computer-run-julia-slower-than-a-slow-computer/5999/2 "2017-09-20T13:59:39Z")

</div>

Is the system-image built for your processor? See point 7 in [http://www.stochasticlifestyle.com/7-julia-gotchas-handle/](http://www.stochasticlifestyle.com/7-julia-gotchas-handle/)

---

<div class="post-metadata">

**Author:** ![evanfields](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evanfields/32/1744_2.png) [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Post date:** [September 20, 2017, 2:05pm UTC](https://discourse.julialang.org/t/why-would-a-fast-computer-run-julia-slower-than-a-slow-computer/5999/3 "2017-09-20T14:05:14Z")

</div>

Yup, thought of that as soon as I wrote the post. You’re right, of course. After building the system image, the desktop runs the simulations about 37% faster than the laptop, single threaded. The BLAS/`peakflops` performance is unchanged though.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [September 20, 2017, 2:12pm UTC](https://discourse.julialang.org/t/why-would-a-fast-computer-run-julia-slower-than-a-slow-computer/5999/4 "2017-09-20T14:12:12Z")

</div>

peakflops has nothing to do with the sysimg build. I kinda doubt openblas (especially the one you use) have be upgraded to recognize Ryzen.
