-
-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more profiling less calls and local copies #8300
Conversation
mousemoveunified can call this very frequently, the cbox copying actually shows up as an impact in such cases, move it down in the scope and only do it when necessery.
profiling shows these as frequent called functions try to reduce the amount of copies with references and const the variables.
remove unneded local copies and const ref cursorsize.
the amount of calls to g_pCompositor->vectorToWindowUnified fast ramps up in cpu usage with enough windows existing and moving the mouse, move the PWINDOWIDEAL up and reuse it if its already the same.
remove unused local copy of accumulateCurrentBufferDamage and const previousBuffer.
also wondering, how are you profiling? callgrind has been kinda dog on my end, and tracy broke a while back. |
pretty much like this, profiling.mp4keep in mind it has tons of various parameters and options to fiddle with, but basicly get pid , |
dope, thanks |
move a few variables down in their scopes to reduce the amount of calls and copies when not needed, also add one more for loop in renderWorkspaceWindows and store the windows in a vector with weakpointers that should be rendered, this adds a loop but reduces the amount of repeated calls to shouldRenderWindow and also makes the rest of the loops go over way smaller vector when many windows exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tack!
more profiling of erraticly moving mouse and generally looking at the most cpu demanding functions appearing doing so.
const ref the things we can, move various objects and variables down in scope to where its actually being used, reduce amount of calls to functions and try reuse already looped and fetched object. mousemoveunified itself could use a refactor but its scary big and i will eventually break something, maybe il attempt it in the future.
add one more for loop in renderWorkspaceWindows and store the windows in a vector with reference wrappers that should be rendered, this adds a loop but reduces the amount of repeated calls to shouldRenderWindow and also makes the rest of the loops go over way smaller vector when many windows exist.
this could use some testing so i didnt actually break something non obvious, works here locally so far. and made marginal gains in the profiling.