Skip to content
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

perf: quick validation of enviroment on activating commands #2400

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ruben-arts
Copy link
Contributor

This pr will add a hash of the lock file to the EnvironmentFile (.pixi/envs/default/conda-meta/pixi)

It will look like this:

{
  "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:

❯ 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

@ruben-arts ruben-arts requested a review from wolfv November 1, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant