Skip to content
M
All projects
Performance2025C++

Computing Benchmark

Measure the machine, not the marketing.

Language
C++23
Default size
1024 × 1024
Block range
32–512
Reports
4 HTML
Commits
16
Updated
Nov 2025

System

How it fits together.

A simplified view of the moving parts, not a full architecture diagram.

  1. 01CLIsize, block, threads, runs
  2. 02Blocked ikjcache-aware kernel
  3. 03Timingsingle vs threaded
  4. 04MetricsGFLOPS, speedup, efficiency
  5. 05HTML reportportable artifact

Context

Why it exists.

Matrix multiplication is a compact way to ask how much a machine actually delivers once memory bandwidth and scheduling enter the picture. The benchmark needed to be portable, explain its own block size, and report more than a single elapsed time.

Approach

  1. 01Block the ikj loop nest so each working set fits the cache.
  2. 02Derive the block size from L1 and the element size, round it to a cache-line multiple, then clamp it to 32–512.
  3. 03Compare two parallel strategies: thread-per-block and fixed row partitioning.
  4. 04Measure single- and multi-threaded runs, derive speedup, efficiency, and GFLOPS, then generate an HTML report from the same output.

Inside the repository

What is actually in there.

Cross-platform cache detection

sysctlbyname on macOS, sysconf and get_nprocs on Linux, GetLogicalProcessorInformation on Windows.

Two schedulers

Thread-per-block parallelizes the outer block loop; the fixed-thread variant partitions rows evenly.

Report generator

A 314-line Python script parses the benchmark output and writes a self-contained HTML report.

Recorded runs

Four reports are checked in, covering an MSI/Arch desktop and two Apple M4 machines.

Constraints & notes

The numbers are self-recorded on the author's machines, not independently reproduced. A prebuilt Linux binary is committed, and the README's Linux build line uses a clang-only flag with g++.