workgroup-decode
Benchmarks latency-critical decode steps pinned to Apple Silicon performance
(P) cores using x/workgroup (UserInteractive QoS + os_workgroup) against
efficiency (E) core Background QoS execution while runtime.NumCPU()
competing background workers saturate the background scheduler band.
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 Background-QoS 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