-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PERF: 5% faster pip install. algorithmic bug at the end of pip instal…
…l in the code to display installed packages. O(n^2) to enumerate installed packages due to accidental loop in loop. get_distribution(package_name) does a loop over all installed packages. that is quite surprising and unexpected. do not use inside a loop. on a pip install run that takes 11 seconds: the loop takes 0.735960 seconds on main branch. the loop takes 0.064672 seconds with this fix.
- Loading branch information
Showing
3 changed files
with
15 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Improve performance of pip install. Fix code to display installed packages at the end of pip install, | ||
was O(n^2) to enumerate packages due to accidental loop in loop. |
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