diff options
author | Todd Gamblin <gamblin2@llnl.gov> | 2021-05-17 01:20:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 01:20:17 -0700 |
commit | fdfd1fed41b4997888ddd87b3d41f627e35c0895 (patch) | |
tree | f99cc7458b5324bf1dab4aeb49131195188c6ad5 /NOTICE | |
parent | 18b436bbb0d15888fb92ba36370f742a57455026 (diff) | |
download | spack-fdfd1fed41b4997888ddd87b3d41f627e35c0895.tar.gz spack-fdfd1fed41b4997888ddd87b3d41f627e35c0895.tar.bz2 spack-fdfd1fed41b4997888ddd87b3d41f627e35c0895.tar.xz spack-fdfd1fed41b4997888ddd87b3d41f627e35c0895.zip |
performance: speed up existence checks in packages (#23661)
Spack doesn't require users to manually index their repos; it reindexes the indexes automatically when things change. To determine when to do this, it has to `stat()` all package files in each repository to make sure that indexes up to date with packages. We currently index virtual providers, patches by sha256, and tags on packages.
When this was originally implemented, we ran the checker all the time, at startup, but that was slow (see #7587). But we didn't go far enough -- it still consults the checker and does all the stat operations just to see if a package exists (`Repo.exists()`). That might've been a wash in 2018, but as the number of packages has grown, it's gotten slower -- checking 5k packages is expensive and users see this for small operations. It's a win now to make `Repo.exists()` check files directly.
**Fix:**
This PR does a number of things to speed up `spack load`, `spack info`, and other commands:
- [x] Make `Repo.exists()` check files directly again with `os.path.exists()` (this is the big one)
- [x] Refactor `Spec.satisfies()` so that a checking for virtual packages only happens if needed
(avoids some calls to exists())
- [x] Avoid calling `Repo.exists(spec)` in `Repo.get()`. `Repo.get()` will ultimately try to load
a `package.py` file anyway; we can let the failure to load it indicate that the package doesn't
exist, and avoid another call to exists().
- [x] Fix up some comments in spec parsing
- [x] Call `UnknownPackageError` more consistently in `repo.py`
Diffstat (limited to 'NOTICE')
0 files changed, 0 insertions, 0 deletions