-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Lower noop wheel install overhead. #2315
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -23,6 +23,7 @@ | |||||||||||||||||||||
from pex.jobs import Raise, SpawnedJob, execute_parallel, iter_map_parallel | ||||||||||||||||||||||
from pex.network_configuration import NetworkConfiguration | ||||||||||||||||||||||
from pex.orderedset import OrderedSet | ||||||||||||||||||||||
from pex.pep_376 import InstalledWheel, LoadError | ||||||||||||||||||||||
from pex.pep_425 import CompatibilityTags | ||||||||||||||||||||||
from pex.pep_427 import InstallableType, WheelError, install_wheel_chroot | ||||||||||||||||||||||
from pex.pep_503 import ProjectName | ||||||||||||||||||||||
|
@@ -485,7 +486,16 @@ def finalize_install(self, install_requests): | |||||||||||||||||||||
# pex: * - paths that do not exist or will be imported via zipimport | ||||||||||||||||||||||
# pex.pex 2.0.2 | ||||||||||||||||||||||
# | ||||||||||||||||||||||
wheel_dir_hash = fingerprint_path(self.install_chroot) | ||||||||||||||||||||||
cached_fingerprint = None # type: Optional[str] | ||||||||||||||||||||||
try: | ||||||||||||||||||||||
installed_wheel = InstalledWheel.load(self.install_chroot) | ||||||||||||||||||||||
except LoadError: | ||||||||||||||||||||||
# We support legacy chroots below by calculating the chroot fingerprint just in time. | ||||||||||||||||||||||
pass | ||||||||||||||||||||||
else: | ||||||||||||||||||||||
cached_fingerprint = installed_wheel.fingerprint | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zmanji so this represents the avoidance of ~3s to hash PyTorch 1 of 2 times. It only works for new caches though (
Comment on lines
+492
to
+496
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally stylistic (no need to change), but is it possible to calculate
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That doesn't work out nice like you think since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, of course; thanks. |
||||||||||||||||||||||
|
||||||||||||||||||||||
wheel_dir_hash = cached_fingerprint or fingerprint_path(self.install_chroot) | ||||||||||||||||||||||
runtime_key_dir = os.path.join(self._installation_root, wheel_dir_hash) | ||||||||||||||||||||||
with atomic_directory(runtime_key_dir) as atomic_dir: | ||||||||||||||||||||||
if not atomic_dir.is_finalized(): | ||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"record_relpath": "attrs-21.5.0.dev0.dist-info/RECORD", "stash_dir": ".prefix"} | ||
{"fingerprint": "13e0015aa58e8f470b17936f42a5d5f874a20194156c371d2a4c695dc8c16d9e", "record_relpath": "attrs-21.5.0.dev0.dist-info/RECORD", "stash_dir": ".prefix"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"record_relpath": "packaging-20.9.dist-info/RECORD", "stash_dir": ".prefix"} | ||
{"fingerprint": "5a3fc5dcd563b4a4474944cd0d73ee4a51fb53132af553abfb203dc1cdf8f7c3", "record_relpath": "packaging-20.9.dist-info/RECORD", "stash_dir": ".prefix"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"record_relpath": "packaging-21.3.dist-info/RECORD", "stash_dir": ".prefix"} | ||
{"fingerprint": "2a93da49a5fc8217a0f710ff0ca3cfc56fefa35eddcf6a64786d452bfa284525", "record_relpath": "packaging-21.3.dist-info/RECORD", "stash_dir": ".prefix"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"record_relpath": "packaging-23.1.dist-info/RECORD", "stash_dir": ".prefix"} | ||
{"fingerprint": "a98c4a74d7b6a62763df7ad330ac4c7a0779323fc36e961aeb8f20865e21a191", "record_relpath": "packaging-23.1.dist-info/RECORD", "stash_dir": ".prefix"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"record_relpath": "pip-20.3.4.dist-info/RECORD", "stash_dir": ".prefix"} | ||
{"fingerprint": "120267325b80f5c4b4adac019eb6617ab3319395c043d2871eedf70dd6ae2954", "record_relpath": "pip-20.3.4.dist-info/RECORD", "stash_dir": ".prefix"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"record_relpath": "setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/RECORD", "stash_dir": ".prefix"} | ||
{"fingerprint": "ebe3717ba6bad87ca328cbf3d3eb3f5475105bccb51dc09a69d37eff6b2e5210", "record_relpath": "setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/RECORD", "stash_dir": ".prefix"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"record_relpath": "toml-0.10.2.dist-info/RECORD", "stash_dir": ".prefix"} | ||
{"fingerprint": "3d44cdc5911c31b190a0225202daafbb22f7f74e6761fb086742dadb5dff5384", "record_relpath": "toml-0.10.2.dist-info/RECORD", "stash_dir": ".prefix"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was, in the end, an unrelated re-name. I was poking around in the resolve / wheel install machinery looking at timings and narrowing in on the double-hashing going on.