# Julia slows down after computer upgrade

**URL:** <https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503>\
**Category:** Performance\
**Created:** [April 3, 2021, 2:08pm UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503 "2021-04-03T14:08:21Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mengxiaoliu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mengxiaoliu/32/23601_2.png) [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Post date:** [April 3, 2021, 2:08pm UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/1 "2021-04-03T14:08:21Z")

</div>

Hi. I am very new to Julia and am not a computer geek so this question may not be very clear. I am happy to add any information as necessary.

I am running Julia on VSCode in Windows. I recently added some memory sticks (128G to 256G) to the PC and found out that Julia was significantly slower. I tried several things including moving the positions of the memory sticks, reinstalling Julia and VSCode, disabling hyperthreading. (in this order). Nothing worked.

I then decided to install Windows Server on my computer, hoping that Julia would behave normally under the new system. It was still slow.

Could anyone give me some suggestions on what to do? Thanks!

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [April 3, 2021, 2:15pm UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/2 "2021-04-03T14:15:33Z")

</div>

Did you run benchmarks, or is this subjective?  
What is the speed of the memory, new and old?  
Maybe an XMP profile was enabled before, but is disabled now? That is, if you buy RAM marked at 3200 MHz and install it, it will run at 2133 MHz until you enable the appropriate memory profile (or manually tweak settings).

---

<div class="post-metadata">

**Author:** ![mengxiaoliu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mengxiaoliu/32/23601_2.png) [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Post date:** [April 3, 2021, 2:50pm UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/3 "2021-04-03T14:50:29Z")

</div>

Thanks for the reply.  
I did not run any benchmarks. I ran the same Julia code, and it takes twice the time to finish (recorded by ProgressMeter). I also noticed that the CPU usage is significantly lower. It dropped from 30-40% to 10-15%.  
My memory sticks are 2133 MHz. I have a duo Xeon CPU E5-2690 v4 @2.60GHz.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [April 4, 2021, 5:45am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/4 "2021-04-04T05:45:58Z")

</div>

> [@mengxiaoliu](#):
>
> Could anyone give me some suggestions on what to do? Thanks!

I would first run a general benchmark suite that has nothing to do with Julia.

---

<div class="post-metadata">

**Author:** ![NiclasMattsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niclasmattsson/32/21988_2.png) [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Post date:** [April 4, 2021, 8:24am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/5 "2021-04-04T08:24:42Z")

</div>

It’s hard to help since your post lacks specifics, especially code. That said…

> [@mengxiaoliu](#):
>
> I ran the same Julia code, and it takes twice the time to finish (recorded by ProgressMeter). I also noticed that the CPU usage is significantly lower. It dropped from 30-40% to 10-15%.

This quote makes me wonder if your code is now running on a single CPU core after previously running on several. Is your code multi-threaded? If so, try running it again in a Julia session started with `julia --threads X` where X is the number of cores on your machine. Or set the `JULIA_NUM_THREADS` environment variable as described [here](https://docs.julialang.org/en/v1/manual/multi-threading/).

---

<div class="post-metadata">

**Author:** ![mengxiaoliu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mengxiaoliu/32/23601_2.png) [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Post date:** [April 5, 2021, 12:02am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/6 "2021-04-05T00:02:46Z")

</div>

I used CINEBENCH to run a benchmark. The multi-core score was 18500 points and the single-core score was 769 points. I’m not sure how to understand these scores. Given that I have a 5-year old computer (running Windows Server 2019 Standard) with Intel Xeon CPU E5-2690 v4 duo processors with 28 cores @ 2.6GHz, I am guessing these are okay scores.

---

<div class="post-metadata">

**Author:** ![Peter\_Adelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peter_adelman/32/11907_2.png) [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)\
**Post date:** [April 5, 2021, 12:49am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/8 "2021-04-05T00:49:13Z")

</div>

It is possible that you are accidentally using multithreading via BLAS if you work with Float32s. Otherwise it would be impossible to hit 40% total CPU utilization on a 28 core machine.

Either way, I am unsure how the RAM could be meaningful here.

---

<div class="post-metadata">

**Author:** ![mengxiaoliu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mengxiaoliu/32/23601_2.png) [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Post date:** [April 5, 2021, 2:33am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/9 "2021-04-05T02:33:31Z")

</div>

I doubt if RAM should be the problem here, too. Just can’t wrap my head around what has happened here. Sorry if my question sounds naïve, but what is the “right” number of BLAS threads I should be using?

---

<div class="post-metadata">

**Author:** ![mengxiaoliu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mengxiaoliu/32/23601_2.png) [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Post date:** [April 5, 2021, 2:33am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/10 "2021-04-05T02:33:55Z")

</div>

I have experimented with multithreading, although my computer has 28 cores, lower thread numbers (4) seem to work better than high thread numbers (28 or higher). In either case, CPU occupancy was low in that it ranges from 10-15% when the program first starts and goes up to 50-60% after the program has been running for 8-9 hours. Ideally, I would like to create a log documenting relevant information, but as you mentioned in your response, I am no sure what information is relevant for you to provide effective suggestions for me.  
Sorry for the long reply, and thanks for your advice!

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [April 5, 2021, 3:08am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/11 "2021-04-05T03:08:13Z")

</div>

A bit of a speculative thing to suggest here. Are there power saving / capping settings here? Your old OS may have had some power saving settings and the new OS more restrictive ones?  
My advice would be to find the latest BIOS for your motherboard then set BIOS options to maximum performance not power saving. Set fan profile to maximum performance.  
Then find a Windows tool which displays CPU states as you are running a Julia program.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [April 5, 2021, 3:10am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/12 "2021-04-05T03:10:00Z")

</div>

Also you refer to moving the memory sticks to different slots. Hold on there. Consult your motherboard manual and place the DIMMs as recommended to keep memory channels balanced.  
Many servers have a diagram on the chassis lid which shows you how to populate DIMM slots.

---

<div class="post-metadata">

**Author:** ![WschW](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wschw/32/6575_2.png) [@WschW](https://discourse.julialang.org/u/WschW)\
**Post date:** [April 5, 2021, 3:10am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/13 "2021-04-05T03:10:31Z")

</div>

> [@mengxiaoliu](#):
>
> My memory sticks are 2133 MHz. I have a duo Xeon CPU E5-2690 v4 @2.60GHz.

But are they running at the speed they are rated for? There are configuration/BIOS reasons that could result in them running slower.

Even if it is running at the same frequency your new RAM may have a longer CAS latency then your old RAM.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [April 5, 2021, 3:15am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/14 "2021-04-05T03:15:54Z")

</div>

If we are talking about memory performance I have been running the stream benchmark on an HPC cluster this weekend. Oh the joys of being an HPC engineer…

> **[MEMORY BANDWIDTH: STREAM BENCHMARK PERFORMANCE RESULTS](https://www.cs.virginia.edu/stream/)**
>
> Sustainable memory bandwidth benchmark, with results on a wide variety of computer systems, from Mac's and PC's to most current and recent workstations to Cray supercomputers.

You would have to look for benchmark numbers from a similar system to see if your system in underperforming.

> **[GitHub - JuliaPerf/STREAMBenchmark.jl: A version of the STREAM benchmark...](https://github.com/JuliaPerf/STREAMBenchmark.jl)**
>
> A version of the STREAM benchmark which measures the sustainable memory bandwidth. - GitHub - JuliaPerf/STREAMBenchmark.jl: A version of the STREAM benchmark which measures the sustainable memory b...

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [April 5, 2021, 6:03am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/15 "2021-04-05T06:03:29Z")

</div>

> [@mengxiaoliu](#):
>
> Given that I have a 5-year old computer (running Windows Server 2019 Standard) with Intel Xeon CPU E5-2690 v4 duo processors with 28 cores @ 2.6GHz, I am guessing these are okay scores.

Sorry if I wasn’t clear, I was suggesting comparing the same benchmark with the old setup (if you still have the old parts, especially the RAM).

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [April 5, 2021, 6:57am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/16 "2021-04-05T06:57:29Z")

</div>

Agreeing with @Tamas_Papp You need a baseline.  
I do benchmarking of HPC systems - the Linpack benchmark still rules, for two reasons (a) it exercises systems and heats them up very well (b) you can compare like with like back several generations.

I believe the Phoronix benchmark suite is pretty well respected in the Windows world

> **[GitHub - phoronix-test-suite/phoronix-test-suite: The Phoronix Test Suite...](https://github.com/phoronix-test-suite/phoronix-test-suite)**
>
> The Phoronix Test Suite open-source, cross-platform automated testing/benchmarking software. - GitHub - phoronix-test-suite/phoronix-test-suite: The Phoronix Test Suite open-source, cross-platform ...

---

<div class="post-metadata">

**Author:** ![mengxiaoliu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mengxiaoliu/32/23601_2.png) [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Post date:** [April 6, 2021, 12:46am UTC](https://discourse.julialang.org/t/julia-slows-down-after-computer-upgrade/58503/17 "2021-04-06T00:46:19Z")

</div>

Thanks for your suggestions. I changed my bios setting as you recommended. My computer did speed up quite a bit! This time I tracked its performance using CineBench and the scores went up after I changed the bios setting.  
The same odd thing happened when I ran my codes, though: the estimated time (calculated by ProgressMeter) initially went down and then gradually increased. Before I added the memory sticks, the estimated time never went up. I cannot figure out if this was because of my codes (I did not change my codes during this process) or because of my computer.
