After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 458762 - proposed tiny optimization for gtk.Adjustment attribute setters
proposed tiny optimization for gtk.Adjustment attribute setters
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: gtk
Git Master
Other All
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2007-07-20 19:50 UTC by Paul Pogonyshev
Modified: 2018-08-17 13:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the optimization patch (3.58 KB, patch)
2007-07-20 19:50 UTC, Paul Pogonyshev
none Details | Review

Description Paul Pogonyshev 2007-07-20 19:50:20 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:
Comment 1 Paul Pogonyshev 2007-07-20 19:50:52 UTC
Created attachment 92067 [details] [review]
the optimization patch
Comment 2 Johan (not receiving bugmail) Dahlin 2007-07-20 20:05:26 UTC
I think this kind of optimization should go into Gtk+ instead, is that possible?
Comment 3 Paul Pogonyshev 2007-07-20 20:38:06 UTC
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
Comment 4 André Klapper 2018-08-17 13:40:32 UTC
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!