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

cheezman34 opened this Issue Jan 11, 2018 · 4 comments


None yet
5 participants

cheezman34 commented Jan 11, 2018

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.


This comment has been minimized.

pytestbot commented Jan 11, 2018 thinks the contributor most likely able to help you is @RonnyPfannschmidt.


This comment has been minimized.


RonnyPfannschmidt commented Jan 11, 2018

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


This comment has been minimized.

edmorley commented Jan 31, 2018

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


This comment has been minimized.


nicoddemus commented Jan 31, 2018

Thanks @edmorley!

@nicoddemus nicoddemus closed this Jan 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment