# Multithreaded code on beefy computer runs just as fast as serial code on M1 Mac

**URL:** https://discourse.julialang.org/t/multithreaded-code-on-beefy-computer-runs-just-as-fast-as-serial-code-on-m1-mac/75210
**Category:** Performance
**Tags:** performance, parallel, differentialequation
**Created:** [January 26, 2022, 2:30am UTC](https://discourse.julialang.org/t/multithreaded-code-on-beefy-computer-runs-just-as-fast-as-serial-code-on-m1-mac/75210 "2022-01-26T02:30:17Z")
**Posts on this page:** 1
**Showing post:** 31

<div class="post-metadata">

### Author: ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://discourse.julialang.org/u/ash)
#### Post date: [January 26, 2022, 7:02pm UTC](https://discourse.julialang.org/t/multithreaded-code-on-beefy-computer-runs-just-as-fast-as-serial-code-on-m1-mac/75210/31 "2022-01-26T19:02:29Z")

</div>

I tried the following:

1. Turning on multithreading with 16 threads. I have an `@floop` over a nested loop with 254 elements per loop, I ignored the single loop as per @tkf’s suggestion. Run time _decreased_ from 590 ms to 510 ms.

2. Turning on OpenBLAS multithreading (16 threads). Run time went up from 510 ms to 783 ms (2498 ms with 8 threads).

3. Switching between MKL and OpenBLAS in serial and parallel. No appreciable change in serial, MKL is 4 times slower in parallel!!

When running this in parallel, the average CPU usage is low, like 200-300% or so.

Something funky is going on with BLAS and MKL.

---

_[View the full topic](https://discourse.julialang.org/t/multithreaded-code-on-beefy-computer-runs-just-as-fast-as-serial-code-on-m1-mac/75210)._
