# Benchmarking nested do loops, MATMUL and Blas DGEMM

> Source: <https://fortran-lang.discourse.group/t/benchmarking-nested-do-loops-matmul-and-blas-dgemm/11043#post_6>
> Published: 2026-08-27 20:59:01+00:00

The M1 and M2 also have a matrix coprocessor (a special matrix acceleration unit): [GitHub - corsix/amx: Apple AMX Instruction Set · GitHub](https://github.com/corsix/amx). In newer chips (M4 and later?) they upgraded this to the [Arm SME extension](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-scalable-matrix-extension-introduction).

In the past I did some benchmarking of the BLAS Level 3 [ dtrsm](https://www.netlib.org/lapack/explore-html/d9/de5/group__trsm_ga7120d931d7b1a15e12d50d328799df8a.html) routine; in the plot below label

`dtrsm`

is for Apple Accelerate and the rest are variants written by GitHub Copilot, some with explicit vectorization using NEON intrinsics:Accelerate is the fastest. Notice the the big jumps when the matrix size is a multiple of 8? I believe that’s the AMX extension.
