Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixtures.reorder_items performs poorly for large numbers of parametrized fixtures #3107

Closed
cheezman34 opened this issue Jan 11, 2018 · 4 comments
Labels
type: performance performance or memory problem/improvement

Comments

@cheezman34
Copy link

If a parametrized fixture generates n items, then reorder_items will have roughly O(n^2) performance. Slice items is called for each item and then iterates over the list of items to find matching groups. We can improve this by pre-caching items by fixture (like argkeys_cache but in reverse).

I've already got code ready for a pull request, I'm just making this issue for record-keeping / discussion.

@pytestbot
Copy link
Contributor

GitMate.io thinks the contributor most likely able to help you is @RonnyPfannschmidt.

@pytestbot pytestbot added the type: performance performance or memory problem/improvement label Jan 11, 2018
@RonnyPfannschmidt
Copy link
Member

thanks for doing all the things in a very detail oriented manner, for personal reasons i wont be able to give it the time it deserves until next week

@edmorley
Copy link

For anyone who arrived here from the changelog, the fix for this landed in #3108.
(This issue can now be closed)

@nicoddemus
Copy link
Member

Thanks @edmorley!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: performance performance or memory problem/improvement
Projects
None yet
Development

No branches or pull requests

5 participants