workgroup-decode
Compares decode latency at UserInteractive QoS with an os_workgroup
against decode latency at Background QoS. Competing workers run at the
same QoS as the low-priority decode mode. On macOS build 26B131, the low-priority
mode and competing workers use Utility because setting Background can hang.
Running
CGO_ENABLED=0 go run ./examples/os/workgroup-decode
Flags:
-steps: timed decode steps per mode (default 200)
-work: inner-loop FMA iterations per decode step (default 32768)
-bg-workers: competing low-priority workers (default runtime.NumCPU())
Measured Results
Measured on an Apple M4 Max (16 cores: 12 P-cores, 4 E-cores) with
CGO_ENABLED=0 go run ./examples/os/workgroup-decode:
workgroup-decode: cpus=16 bg-workers=16 steps=200 work=32768 max-parallel-threads=16
MODE QOS (ACTUAL) WORKGROUP P50 P95 P99 THROUGHPUT
P-core decode UserInteractive (rel=0) yes 53µs 78µs 139µs 2523.5 steps/s
E-core background Background (rel=0) no 118µs 1.916ms 68.336ms 369.7 steps/s
P-core speedup vs Background: 493.25x lower p99 latency, 6.83x higher throughput