From c62d3dd82ce0152c49489f0de059df53389d8ff1 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 3 Apr 2022 23:35:53 -0400 Subject: [PATCH] Add profiling to xrange update loop --- piker/ui/_interaction.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index adc551dc..bd59992f 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -37,6 +37,7 @@ from ..log import get_logger from ._style import _min_points_to_show from ._editors import SelectRect from . import _event +from .._profile import pg_profile_enabled, ms_slower_then # from ._ohlc import BarItems @@ -862,10 +863,16 @@ class ChartView(ViewBox): chart = self._chart # graphics = list(self._chart._graphics.values()) + profiler = pg.debug.Profiler( + msg=f'FastAppendCurve.update_from_array(): `{chart.name}`', + disabled=not pg_profile_enabled(), + gt=ms_slower_then, + ) for name, graphics in chart._graphics.items(): # pass in no array which will read and render from the last # passed array (normally provided by the display loop.) chart.update_graphics_from_array(name) + profiler(f'updating {name}') # for graphic in graphics: # ds_meth = getattr(graphic, 'maybe_downsample', None)