GNOME Bugzilla – Bug 765300
gutterrenderer: avoid signal emission when possible
Last modified: 2016-04-20 09:34:17 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.
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.
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 */