Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(exec): improve performance (#433)
...by only parsing installed packages for their environment variables if we are in a deactivated hermit environment. When activated, the parent shell will have already passed the new process all environment variables, including packages that were installed after initial activation. Parsing the HCL configs of all installed packages introduces some overhead. This can be non-negligible when hermit-managed packages are used a large number of times - for instance with javac or rustc. Here is a very exaggerated example on a project with 42 installed packages: Before change: ```bash $ time make --version > /dev/null real 0m0.143s user 0m0.136s sys 0m0.033s ``` After change: ```bash $ time make --version > /dev/null real 0m0.013s user 0m0.013s sys 0m0.000s ``` No hermit: ```bash $ time /usr/bin/make --version > /dev/null real 0m0.002s user 0m0.001s sys 0m0.001s ```
- Loading branch information