Skip to content

Conversation

SimonHeybrock
Copy link
Member

This seems to save, e.g., 0.3 seconds a whole bunch of times. Not huge but noticeable. Is it a good idea?

Copy link
Member

@jl-wynen jl-wynen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this code spread out across most (all?) of our packages. And it is slightly different everywhere. Can we move this to a common location so that we benefit from caching everywhere?

def __contains__(self, key):
return key in self._registry.registry

@cache # noqa: B019
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a comment why it is ok to cache self in this case?

SimonHeybrock and others added 2 commits August 8, 2025 15:07
This seems to save, e.g., 0.3 seconds a whole bunch of times. Not huge
but noticeable. Is it a good idea?
@jl-wynen
Copy link
Member

jl-wynen commented Aug 8, 2025

I updated the PR to use scipp/essreduce#261. The tests should pass as is but will only benefit from caching once ESSreduce is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants