You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows each qbs session process consumes a .1-.3 % of my CPU when idle. With 4 processes this doubles the idle usage of my laptop and is a huge waste of battery.
Goals:
Do not drain my battery / consume idle power
Reduce extra processes and communication overhead
Analysis:
qbs session communicates over stdin and stdout with host process (QtCreator)
uses a QTimer to check if data was sent every 10ms
A qbs session process is spawned for each project configuration (Up to 4 per project - I guess debug/release and 2nd config)
clangbackend is not measurable on idle.
uses seperate named pipe (non blocking socket)
stdio is forwarded to qtcreator (not used for communication)
custom QDataStream based encoding (only useful for Qt environments)
clangd used by VsCode is not measurable on idle.
simple use of blocking stdin
mitigates debugger interrupts (see clang-tools-extra/clangd/JSONTransport.cpp)
seems to spawn threads for actual work
Experiments on qbs:
Even waiting for 90ms effectively brick qbs.
Using singleShot timer might help for sleeping. But does not stop idle drain.
Perfect solution:
Write a dedicated qbsd
use approach from clangd with blocking stdin reading
spawn/communicate with thread per session
hope: qbscore was doing something similar when it was part of qtcreator?
possible challenges:
protocol needs to be extended by something like a sessionId, start and end of sessions.
qtcreator needs to hold a common instance and despawn qbsd when not needed
Hacking solution:
Use worker thread in qbs to read stdin blockingly
Abort thread by closing stdin
Process received data with signals
Alternatives:
Use CompletionIO for Windows
Would require adding completion IO support to Qt main loop (might not be actually hard, but requires very careful design)
The text was updated successfully, but these errors were encountered:
Observation:
qbs session
processesqbs session
process consumes a .1-.3 % of my CPU when idle. With 4 processes this doubles the idle usage of my laptop and is a huge waste of battery.Goals:
Analysis:
qbs session
communicates over stdin and stdout with host process (QtCreator)QTimer
to check if data was sent every 10msqbs session
process is spawned for each project configuration (Up to 4 per project - I guess debug/release and 2nd config)clangbackend
is not measurable on idle.clangd
used by VsCode is not measurable on idle.clang-tools-extra/clangd/JSONTransport.cpp
)Experiments on qbs:
Perfect solution:
qbsd
qbsd
when not neededHacking solution:
Alternatives:
The text was updated successfully, but these errors were encountered: