Quassel requests 1ms timer precision on Windows client
Quassel is requesting 1ms timer precision on the Windows client which has the potential to hurt battery life on mobile devices. Is there any particular reason that quassel is requesting such high precision? Or is it just a QT thing that's getting bundled?
This should be a relatively straightforward fix if it doesn't need that precision. Just not sure where it's coming from yet but I can try and look into it.
#1 Updated by ben-zen about 1 year ago
From some code investigation, Quassel's using a bunch of QTimers, and I went and dug into how Qt itself handles timers; the really juicy details are in https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qeventdispatcher_win.cpp -- searching for
SetTimer finds the way these timers are created.
Basically, Qt is using the non-coalesceable timers for everything; this seems like a spot where it'd be advantageous to make possibly both
VeryCoarseTimer timers not just round their intervals, but also switch to coalescing overall. It looked like basically all the timers in Quassel are coarse, so this would immediately benefit this codebase. But this is an attempt to patch something in the framework, so who knows when it'd happen.
Within Quassel, it's also worth seeing if all these timers are actually needed. I haven't done a full survey yet to see if there's really no other way to achieve some goals.