Issue Description
Qoder holds the Windows system timer resolution at 0.5 ms — the most aggressive value the platform supports (the Windows default is 15.625 ms). As a result the CPU never leaves max turbo even though the machine is essentially idle: ~90% idle time and only ~1% total per-process CPU across all logical cores, yet the clock stays pinned near maximum turbo continuously.
This happens both when Qoder is in the foreground and when it is minimised to the system tray. The visible effect is elevated idle power draw, package temperature and fan noise.
Measured with NtQueryTimerResolution (ntdll.dll) while Qoder was running:
minimum resolution = 0.500 ms
maximum resolution = 15.625 ms
current resolution = 0.500 ms <-- most aggressive value supported
powercfg /requests (elevated) returned empty for every category — DISPLAY, SYSTEM, AWAYMODE, EXECUTION, PERFBOOST, ACTIVELOCKSCREEN — so this is not SetThreadExecutionState preventing idle. It is purely the timer-wakeup path.
Snippet used to measure, in case it helps reproduce:
Add-Type -Namespace Win -Name Timer -MemberDefinition @'
[System.Runtime.InteropServices.DllImport("ntdll.dll")]
public static extern int NtQueryTimerResolution(out uint Max, out uint Min, out uint Cur);
'@
$max=[uint32]0; $min=[uint32]0; $cur=[uint32]0
[Win.Timer]::NtQueryTimerResolution([ref]$max,[ref]$min,[ref]$cur) | Out-Null
"min=$($min/10000)ms max=$($max/10000)ms current=$($cur/10000)ms"
Steps to Reproduce
- Let the system idle for a few minutes and confirm the CPU clock drops to a low value.
- Launch Qoder.
- Watch the CPU clock (Task Manager → Performance → CPU, or the
% Processor Information(_Total)\% Processor Performancecounter). - Minimise Qoder to the system tray and watch again.
- Quit Qoder completely and watch again.
Expected Behavior
With no active work the CPU should be allowed to drop to a low P-state. An idle Qoder — especially one minimised to the tray — should not need a 0.5 ms timer resolution.
Actual Behavior
Within seconds of launching Qoder the CPU is pinned near max turbo and stays there indefinitely, including when minimised to the tray. It only drops back after Qoder is fully quit. Reproducible every time.
| Metric | Observed |
|---|---|
% Processor Performance |
~170% of base clock, sustained |
% Idle Time |
~90% |
| Sum of per-process CPU over a 30 s window | ~1% of all logical cores |
% Interrupt Time / % DPC Time |
~0% |
For triage: changing the Windows power plan makes no difference — switching to Power Saver leaves the clock pinned exactly the same.
Hypothesis
Chromium-based apps normally request 1 ms via timeBeginPeriod. 0.5 ms is more aggressive than that, which suggests an explicit NtSetTimerResolution(5000, TRUE) or timeBeginPeriod(0) somewhere rather than the usual Chromium path.
On recent Windows 11 builds timer-resolution requests are per-process, so Qoder’s request should not globally raise other processes’ tick rate. But it does not need to: Qoder runs a dozen or so processes, and at 0.5 ms that is on the order of 2000 wakeups per second from Qoder alone. That wake storm by itself is enough to keep the package out of deep C-states, so HWP keeps issuing a high performance request and the CPU stays at max turbo — while reported CPU usage stays near zero, because each wakeup only does microseconds of work.
I cannot attribute the 0.5 ms request to a specific Qoder subsystem from outside the process. Candidates worth auditing: an audio/media path, a Node/V8 timer, or a compositor/vsync loop in the Electron main or renderer processes.
Impact
- Idle power draw, package temperature and fan noise are significantly higher than they should be, purely from having Qoder open.
- On laptops this would be a noticeable battery-life regression.
- It masks real load in monitoring tools: the CPU reads ~1% busy but runs at full turbo, which makes thermal and performance diagnosis misleading.
Request: could you confirm whether the 0.5 ms timer-resolution request is intentional? If not, it would be worth locating the caller and, at minimum, releasing the request when the window is minimised to the tray.
Screenshots / Screen Recordings
None. The measurements above are console output. The effect is also plainly visible in Task Manager → Performance → CPU: frequency stays at maximum while utilisation sits near zero.
Operating System
Windows 11
Current Qoder Version (Menu → About Qoder → Copy)
0.1.8