forked from prefix-dev/pixi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Quick prefix validation check (prefix-dev#2400)
This pr will add a hash of the lock file to the `EnvironmentFile` (`.pixi/envs/default/conda-meta/pixi`) It will look like this: ```json { "manifest_path": "/home/rarts/dev/pixi/pixi.toml", "environment_name": "default", "pixi_version": "0.34.0", "environment_lock_file_hash": "4f36ee620f10329d" } ``` And that hash will be compared with the current lockfile on `pixi run` `pixi shell` `pixi shell-hook`. ### Profile result ```shell ❯ hyperfine "pixi run echo" "old-pixi run echo" Benchmark 1: pixi run echo Time (mean ± σ): 381.6 ms ± 22.1 ms [User: 193.8 ms, System: 246.3 ms] Range (min … max): 344.5 ms … 414.3 ms 10 runs Benchmark 2: old-pixi run echo Time (mean ± σ): 868.2 ms ± 58.2 ms [User: 480.0 ms, System: 557.0 ms] Range (min … max): 791.1 ms … 950.8 ms 10 runs Summary pixi run echo ran 2.28 ± 0.20 times faster than old-pixi run echo ``` > [!NOTE] > The remaining `381ms` is the activation which is fixed by prefix-dev#2367 ### UX - It's turned on by default - You can request a re-validate on `pixi run/shell/shell-hook` with `--revalidate` - All commands designed to update the lock file or `pixi install` will always re-validate. ### TODO: - [x] : Add tests: chosen python integration tests as I was to fed up with the extreme amount of time spent on writing tests in Rust - [x] : use Enum instead of booleans. Using `UpdateMode::QuickValidate` and `UpdateMode::Revalidate` - [x] : Document behavior - [x] : Extend logic to cli. `--revalidate` --------- Co-authored-by: Hofer-Julian <[email protected]>
- Loading branch information
1 parent
c2ea77b
commit d7230cf
Showing
24 changed files
with
436 additions
and
93 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
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
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
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
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
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
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
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
Oops, something went wrong.