mirror of
https://github.com/InstanceBrick/nightcap.git
synced 2026-10-23 06:00:55 +02:00
The main thread polls nativeCallMessagesFromMainThread 146k times a second with nothing to do. Between polls it now rests 100 us: nanosleep when the governor is performance, TPAUSE (C0.2) when the CPU has WAITPKG, a spin otherwise. Sleeping under a power-saving governor lets the render thread's core clock down and drops frames, which is why TPAUSE is the default there. MOCKTAIL_ENGINE_PUMP_REST=sleep|tpause|spin overrides. The profile trace gains a slice for pumps that ran a message.