File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/frequenz/sdk/timeseries Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -355,10 +355,12 @@ def resample(self, timestamp: datetime) -> Sample:
355355 # specifying a key extraction function in Python 3.10, so we need to
356356 # compare samples at the moment.
357357 cut_index = bisect (self ._buffer , Sample (minimum_relevant_timestamp , None ))
358- # pylint: disable=fixme
359- # FIXME: This is far from efficient, but we don't want to start new
360- # ring buffer implementation here that uses a list to overcome the
361- # deque limitation of not being able to get slices
358+ # Using itertools for slicing doesn't look very efficient, but
359+ # experiements with a custom (ring) buffer that can slice showed that
360+ # it is not that bad. See:
361+ # https://github.com/frequenz-floss/frequenz-sdk-python/pull/130
362+ # So if we need more performance beyond this point, we probably need to
363+ # resort to some C (or similar) implementation.
362364 relevant_samples = list (itertools .islice (self ._buffer , cut_index , None ))
363365 value = (
364366 conf .resampling_function (relevant_samples , conf .resampling_period_s )
You can’t perform that action at this time.
0 commit comments