Repository navigation
Conversation
GTK relayouts the whole window on every GtkLabel set_label()/set_text(), even when the text is the same. gmoccapy rewrote the feed, velocity, spindle and Vc labels and the clock every 100 ms cycle, and Combi_DRO its three readouts on every position update, so an idle gmoccapy redrew its window 10 times a second. Only set a label when its text changed, and update the clock from the 1 s timer, since it only shows seconds. Idle 4-axis sim: CPU from ~10.5% to ~7% of one core, window redraws from 10/s to 1/s.
Gremlin.map() started a new 50 ms poll timer each time the widget was mapped, and poll() never stops, so every hide and show of the preview (eg opening and leaving gmoccapy's settings page) left one more timer polling linuxcnc status for the rest of the session. Keep the timer id, start it only if none is running, and stop it on unmap since there is nothing to draw while hidden.
warning_dialog() watches the confirm and active pins with a 100 ms timer that only ends when a pin closes the dialog. Closing it with the Ok button left the timer running forever, so every operator warning leaked a timer, which later tried to close a destroyed dialog when the pin went high. Remove the timer after the dialog returns, unless a pin already ended it.
Contributor
|
Is this #4754 related? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this improves performance, gtk redraws when you update the label.
also removes some timer leaks.
if you launch with GTK_DEBUG=interactive, then set visual -> show graphic updates you will see the difference.