Module Benchmark.CPUOptimization

CPU affinity and performance optimization.

A thin convenience layer over Affinity, which is where the platform story is documented.

val isolate_cpu : int -> (unit, string) Stdlib.result

Pin the calling thread to core. Really pins on Linux; Error everywhere else.

val optimize_for_latency : unit -> (unit, string) Stdlib.result

Always Error. The CPU governor and turbo boost are root-level sysfs settings that a process cannot apply to itself; the operator does this at the machine level. Kept rather than deleted so the answer is discoverable at the call site instead of only in a guide.

Some c where c is the last core, when the machine has more than four. None otherwise — on a small machine there is no core to spare.