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 765300 - gutterrenderer: avoid signal emission when possible
gutterrenderer: avoid signal emission when possible
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-20 09:13 UTC by Christian Hergert
Modified: 2016-04-20 09:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gutterrenderer: avoid signal emission when possible (1.38 KB, patch)
2016-04-20 09:13 UTC, Christian Hergert
committed Details | Review

Description Christian Hergert 2016-04-20 09:13:18 UTC
I noticed that gtk_source_gutter_renderer_query_data() was showing up pretty
often on profiles, since it is used to populate state similar to a cell
renderer.

This avoids the signal emission when possible.
Comment 1 Christian Hergert 2016-04-20 09:13:20 UTC
Created attachment 326392 [details] [review]
gutterrenderer: avoid signal emission when possible

When we simply have a subclass that overrides ::query_data vfunc and no
signals connected, we can avoid the signal emission altogether.

This is similar to what GtkWidget::draw does to avoid signal emission.
Comment 2 Paolo Borelli 2016-04-20 09:19:47 UTC
Review of attachment 326392 [details] [review]:

ok, but let's add a comment along the lines of

/* Signal emission is relatively expensive and this code path
 * is frequent enough to optimize the common case where we only
 * have the override and no connected handlers.
 * This is the same trick used by GtkWidget::draw
 */