# What's the optimal setting for JULIA\_NUM\_THREADS on a Macbook Pro M1 Max

**URL:** <https://discourse.julialang.org/t/whats-the-optimal-setting-for-julia-num-threads-on-a-macbook-pro-m1-max/75928>\
**Category:** Performance\
**Tags:** multithreading\
**Created:** [February 7, 2022, 12:06am UTC](https://discourse.julialang.org/t/whats-the-optimal-setting-for-julia-num-threads-on-a-macbook-pro-m1-max/75928 "2022-02-07T00:06:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![navidcy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/navidcy/32/2750_2.png) [@navidcy](https://discourse.julialang.org/u/navidcy)\
**Post date:** [February 7, 2022, 12:06am UTC](https://discourse.julialang.org/t/whats-the-optimal-setting-for-julia-num-threads-on-a-macbook-pro-m1-max/75928/1 "2022-02-07T00:06:22Z")

</div>

with Total Numbers of Cores: 10 (8 performance and 2 efficiency)?

Is it 10? 8? 20? 16?

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [February 7, 2022, 12:48am UTC](https://discourse.julialang.org/t/whats-the-optimal-setting-for-julia-num-threads-on-a-macbook-pro-m1-max/75928/2 "2022-02-07T00:48:01Z")

</div>

8 threads is probably the best, on the normal M1 4 threads is best, so I imagine 8 is what works

---

<div class="post-metadata">

**Author:** ![navidcy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/navidcy/32/2750_2.png) [@navidcy](https://discourse.julialang.org/u/navidcy)\
**Post date:** [February 7, 2022, 12:56am UTC](https://discourse.julialang.org/t/whats-the-optimal-setting-for-julia-num-threads-on-a-macbook-pro-m1-max/75928/3 "2022-02-07T00:56:19Z")

</div>

If I start Julia with `--thread=auto` it picks 6.

🙄

```julia
navid:~/ $ /Users/navid/julia/julia --threads=auto
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.8.0-DEV.1449 (2022-02-04)
 _/ |\ __'_|_|_|\__'_| | Commit 9c5d7ff446 (2 days old master)
|__/ |

julia> Base.Threads.nthreads()
6

```

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [February 8, 2022, 12:39pm UTC](https://discourse.julialang.org/t/whats-the-optimal-setting-for-julia-num-threads-on-a-macbook-pro-m1-max/75928/4 "2022-02-08T12:39:56Z")

</div>

> `auto` currently sets N to the number of local CPU threads but **this might change in the future**

The future is now? 🙂

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [February 8, 2022, 12:55pm UTC](https://discourse.julialang.org/t/whats-the-optimal-setting-for-julia-num-threads-on-a-macbook-pro-m1-max/75928/5 "2022-02-08T12:55:19Z")

</div>

The future is now, since there are cpus with efficiency cores and performance cores, but the issue in the OP was a bug.
