Skip to content

Conversation

@baszalmstra
Copy link
Contributor

This PR improves performance of any command that install an environment by lazily evaluating the activation variables. We only need the activation variables when we will be building an sdist, which is very often not the case.

Previously, we were always activating the environment when we needed to get an up-to-date environment.

Testing this locally on my machine, pixi feels much more snappy.

@ruben-arts
Copy link
Contributor

ruben-arts commented Oct 2, 2025

Testing this branch on my Mac

Workspace with ROS dependencies:

ros_workspace on  main [!?] 🧚  took 42s 
➜ hyperfine "pixi i" "pixi54 i" -w 2
Benchmark 1: pixi i
  Time (mean ± σ):     151.4 ms ±   3.0 ms    [User: 121.1 ms, System: 107.8 ms]
  Range (min … max):   147.4 ms … 161.9 ms    19 runs
 
Benchmark 2: pixi54 i
  Time (mean ± σ):     442.2 ms ± 145.4 ms    [User: 291.1 ms, System: 660.4 ms]
  Range (min … max):   359.0 ms … 797.2 ms    10 runs
 
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Summary
  pixi i ran
    2.92 ± 0.96 times faster than pixi54 i

samply record pixi install: https://share.firefox.dev/4pSbS7o

Workspace with only python and rust:

~/envs/snap 🧚  
➜ hyperfine "pixi i" "pixi54 i"
Benchmark 1: pixi i
  Time (mean ± σ):      16.2 ms ±   1.6 ms    [User: 5.5 ms, System: 13.0 ms]
  Range (min … max):    14.3 ms …  25.1 ms    105 runs
 
Benchmark 2: pixi54 i
  Time (mean ± σ):     140.4 ms ±  21.0 ms    [User: 83.1 ms, System: 40.9 ms]
  Range (min … max):   133.3 ms … 210.1 ms    13 runs
 
  Warning: The first benchmarking run for this command was significantly slower than the rest (210.1 ms). This could be caused by (filesystem) caches that were not filled until after the first run. You should consider using the '--warmup' option to fill those caches before the actual benchmark. Alternatively, use the '--prepare' option to clear the caches before each timing run.
 
Summary
  pixi i ran
    8.65 ± 1.53 times faster than pixi54 i

On Pixi itself:

➜ hyperfine "pixi i" "pixi54 i" -w 2
Benchmark 1: pixi i
  Time (mean ± σ):      47.0 ms ±   3.7 ms    [User: 32.6 ms, System: 44.3 ms]
  Range (min … max):    43.1 ms …  59.8 ms    61 runs
 
Benchmark 2: pixi54 i
  Time (mean ± σ):     321.6 ms ±  27.7 ms    [User: 164.1 ms, System: 229.5 ms]
  Range (min … max):   296.5 ms … 375.3 ms    10 runs
 
Summary
  pixi i ran
    6.84 ± 0.80 times faster than pixi54 i

Great improvement! 🚀

Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ruben-arts ruben-arts merged commit 2d839a3 into prefix-dev:main Oct 2, 2025
38 checks passed
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.

2 participants