Skip to content

move Bestrelpath cache move to session#4314

Merged
nicoddemus merged 1 commit intopytest-dev:featuresfrom
RonnyPfannschmidt:bestrelpath-cache-move-to-session
Nov 5, 2018
Merged

move Bestrelpath cache move to session#4314
nicoddemus merged 1 commit intopytest-dev:featuresfrom
RonnyPfannschmidt:bestrelpath-cache-move-to-session

Conversation

@RonnyPfannschmidt
Copy link
Member

this removes a perky monkey-patch on configu


def _node_location_to_relpath(self, node_path):
# bestrelpath is a quite slow function
return self._bestrelpathcache[node_path]
Copy link
Contributor

Choose a reason for hiding this comment

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

What about using lru_cache here?
Or mark is as TODO, since py27 does not use it.
(we could also backport it for py27, of course, if we're starting to use it more/here)

Copy link
Member Author

Choose a reason for hiding this comment

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

lru cache has a significantly higher complexity - for a full cache (like this one) its overcill ^^
that being said - in a few iterations the cache will be gone for more effective ways

@nicoddemus nicoddemus merged commit 1752c7e into pytest-dev:features Nov 5, 2018
@RonnyPfannschmidt RonnyPfannschmidt deleted the bestrelpath-cache-move-to-session branch November 30, 2018 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants