# 1.8 much slower than 1.6

**URL:** <https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254>\
**Category:** General Usage\
**Created:** [October 25, 2022, 3:33pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254 "2022-10-25T15:33:14Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [November 2, 2022, 3:26pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254/21 "2022-11-02T15:26:38Z")

</div>

Are you perhaps using GLM? I have a discussion where I found excessive usage in julia recently (I don’t know when it started, but it wasn’t there when I originally developed the script) and it looked like GLM was using too many threads for regression. I guess it uses LinearAlgebra under the covers. I fixed it by reducing the BLAS thread count.

You can see the discussion here: [Huge CPU load when using GLM](https://discourse.julialang.org/t/huge-cpu-load-when-using-glm/89209)

---

<div class="post-metadata">

**Author:** ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Post date:** [November 8, 2022, 11:30am UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254/22 "2022-11-08T11:30:56Z")

</div>

I found the solution.  
I know we don’t use julia the right way. We run every script in the global environment 😕 (but we wanna change it soon)

BUT - the solution was:  
I put

```julia
import Pkg

Pkg.activate()

```

at the very beginning of each script.

Thanks for all the help

Edit:  
Not sure if the obove was the solution.  
I just found out that `JULIA_NUM_THREADS=4` was also needed.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 8, 2022, 1:04pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254/23 "2022-11-08T13:04:21Z")

</div>

I find this solution quite disturbing as it seems to imply that packages may interact in unknown ways to slow down the run.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [November 8, 2022, 2:34pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254/24 "2022-11-08T14:34:35Z")

</div>

> [@joa-quim](#):
>
> it seems to imply that packages may interact in unknown ways to slow down the run.

Probably just different versions of packages being used.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 8, 2022, 2:43pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254/25 "2022-11-08T14:43:16Z")

</div>

> [@kristoffer.carlsson](#):
>
> Probably just different versions of packages being used.

And would that justify a “much slower than”?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [November 8, 2022, 2:44pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254/26 "2022-11-08T14:44:58Z")

</div>

I guess those versions are slower than the other ones. Shouldn’t be too hard to verify, run the code with the same Project + Manifest on different julia versions and see if there is a perf difference.

---

<div class="post-metadata">

**Author:** ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Post date:** [November 28, 2022, 3:55pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254/27 "2022-11-28T15:55:42Z")

</div>

> [@Impressium](#):
>
> Edit:  
> Not sure if the obove was the solution.  
> I just found out that `JULIA_NUM_THREADS=4` was also needed.

But I’m very much interested why the change in my last edit works. I run 6 scripts in parallel and wanna give them as much CPU as possible. Why do I need to restricht it to less than the system can offer?

[Previous page](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254.md?page=1)
