widget: Speed up verify_invariants()
authorTimm Bäder <mail@baedert.org>
Thu, 6 Feb 2020 07:17:51 +0000 (08:17 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 7 Feb 2020 18:15:59 +0000 (13:15 -0500)
commite152d25ac06529792c2822d73a40b91e283ba80c
tree5c5a959a016bfe01bbc9f0d90810d8f46e04b69b
parentb561eb829949056c4f88cd97a24f389e32d511d5
widget: Speed up verify_invariants()

Hide the expensive GTK_IS_ROOT() checks behind the cheaper realized,
mapped, etc. checks. This way we only check for the widget being a root
if the invariant does not hold.

This gets pop_verify_invariants() from 16% to 6% when running the
scrolling benchmark in the widget-factory.
gtk/gtkwidget.c