summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorTodd Gamblin <gamblin2@llnl.gov>2021-05-17 01:20:17 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2021-05-22 14:57:30 -0700
commit818664d55aa324430e770188f1116248f4966e68 (patch)
treedad0b06f35ab19704bb7de3496e99c1e688f015a /share
parent76c5a02125b31a7d50dab10a51d526c8594aefb6 (diff)
downloadspack-818664d55aa324430e770188f1116248f4966e68.tar.gz
spack-818664d55aa324430e770188f1116248f4966e68.tar.bz2
spack-818664d55aa324430e770188f1116248f4966e68.tar.xz
spack-818664d55aa324430e770188f1116248f4966e68.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 'share')
0 files changed, 0 insertions, 0 deletions