You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed the use of index() in this code block causes a significant performance issue when a node has a large number of tests. This can be improved by precomputing a mapping from node ID to index using a dictionary and look it up in the loop.
eg.
index_map = {nodeid: i for i, nodeid in enumerate(worker_collection)}
nodeids_indexes = [
index_map[nodeid]
for nodeid, completed in work_unit.items()
if not completed
]
To reproduce the issue, you can run pytest -n 2 --dist=loadscope with the following test code: