gnome-prototypes-team / gnome-music

Gnome Music
https://live.gnome.org/Music
Other
5 stars 13 forks source link

view: cache vadjustment #105

Closed vrutkovs closed 11 years ago

vrutkovs commented 11 years ago
File: ./gnomemusic/view.py
Function: _connect_view at line 140
Total time: 0.000126 s

Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
   140                                               @profile
   141                                               def _connect_view(self):
   142         3           86     28.7     68.3          vadjustment = self.view.get_vadjustment()
   143         3            6      2.0      4.8          self._adjustmentValueId = vadjustment.connect(
   144         3            3      1.0      2.4              'value-changed',
   145         3           31     10.3     24.6              self._on_scrolled_win_change)
gquintard commented 11 years ago

set_stack is only used once, and get_stack implementation (in libgd) is already pretty optimal, not sur we can do a lot on these.

kyoushuu commented 11 years ago

The vadjustment is being used in _on_scrolled_win_change too, so we should cache it.

vrutkovs commented 11 years ago

Fixed #105 via #171