Skip to content

stop Gmoccapy from updating the labels all the time - #4776

Open
rene-dev wants to merge 3 commits into
LinuxCNC:masterfrom
rene-dev:gmoccapy-performance
Open

rene-dev wants to merge 3 commits into
LinuxCNC:masterfrom
rene-dev:gmoccapy-performance

Conversation

@rene-dev

@rene-dev rene-dev commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

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.

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.
@rene-dev
rene-dev requested a review from gmoccapy November 4, 2026 23:10
@grandixximo

Copy link
Copy Markdown
Contributor

Is this #4754 related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants