From 3845e0c00e1dc440d3f30226303562b717c7990f Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 19 Jul 2023 20:36:35 -0700 Subject: [PATCH] sysprof: reduce expiry check to once every 10 iterations --- src/sysprof/sysprof-normalized-series.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sysprof/sysprof-normalized-series.c b/src/sysprof/sysprof-normalized-series.c index 22d12a07..cd2e563b 100644 --- a/src/sysprof/sysprof-normalized-series.c +++ b/src/sysprof/sysprof-normalized-series.c @@ -90,6 +90,7 @@ sysprof_normalized_series_update_missing (gint64 deadline, if (egg_bitset_iter_init_first (&iter, bitset, &position)) { + guint count = 0; guint first = position; for (;;) @@ -104,6 +105,8 @@ sysprof_normalized_series_update_missing (gint64 deadline, g_assert (self->values->len > position); + count++; + if (!self->inverted) *fval = _sysprof_axis_normalize (self->axis, &value); else @@ -114,7 +117,8 @@ sysprof_normalized_series_update_missing (gint64 deadline, if (self->disposed) break; - expired = g_get_monotonic_time () >= deadline; + /* Only do expiry check every 10 items */ + expired = count % 10 == 0 && g_get_monotonic_time () >= deadline; if (!egg_bitset_iter_init_first (&iter, bitset, &next) || next != position + 1 ||