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
{{ message }}
Repository navigation
MapInfra shuffles items even when computing them inline (cluster=None) #349
MapInfra shuffles the missing items before calling the decorated method, even with cluster=None, where they are all computed in a single call (exca 0.6.0):
This hurts when consecutive items could share an expensive resource, e.g. loading the same audio or video file.
Would you accept keeping the input order for inline computation (cluster=None)? Suggested change:
if len(missing) == 1:
pool = None
- # avoid processing same files at same time if several jobs overlap- np.random.shuffle(missing)+ if pool is not None: # inline computation keeps the input order+ # avoid processing same files at same time if several jobs overlap+ np.random.shuffle(missing)
Happy to open a PR with this change and a test.
Side note: the shuffle also advances the global NumPy random state, only on cache misses.
Activity