-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MRG: fix exponential time explosion in
sig check
(#2762)
Fixes #2646. Embarrassing "let's make things run really slow" typo of the month... fixed! In brief, the following code in `manifest.py` was causing an exponential explosion in time cost: ```python def _add_rows(self, rows): self.rows.extend(rows) # maintain a fast check for md5sums for __contains__ check. md5set = self._md5_set for row in self.rows: md5set.add(row['md5']) ``` when called many times on a single row, because each addition of a row triggered an iteration over ALL rows. This PR changes things so that we do `for row in rows:`. Additional complexity => new tests to deal explicitly with the case where `rows` is a generator (which it turns out it often is, breaking dozens of tests when not accounted for)
- Loading branch information
Showing
3 changed files
with
94 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters