GNOME Bugzilla – Bug 458762
proposed tiny optimization for gtk.Adjustment attribute setters
Last modified: 2018-08-17 13:40:32 UTC
Please describe the problem: Optimization removes emitting of 'changed' and 'value-changed' signals in case assignment of an attribute doesn't actually change anything. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 92067 [details] [review] the optimization patch
I think this kind of optimization should go into Gtk+ instead, is that possible?
Not really. GTK+ is optimized in that way it doesn't emit 'changed' signal itself. You are supposed to emit it after you are done with your changes. PyGTK simplifies things by emitting it after any change in adjustment properties. That certainly leads to excessive emission (like 3 'changed' when you just reconfigure an adjustment in essentially a single operation.) This patch only somewhat improves this by not emitting the signal if nothing changes as a result of a single assignment. E.g. before: adjustment.upper = 100 # 'changed' emitted adjustment.upper = 100 # 'changed' emitted after: adjustment.upper = 100 # 'changed' emitted adjustment.upper = 100 # 'changed' not emitted
pygtk is not under active development anymore and had its last code changes in 2013. Its codebase has been archived: https://gitlab.gnome.org/Archive/pygtk/commits/master PyGObject at https://gitlab.gnome.org/GNOME/pygobject is its successor. See https://pygobject.readthedocs.io/en/latest/guide/porting.html for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent version of PyGObject. Thanks!