pixi icon indicating copy to clipboard operation
pixi copied to clipboard

chore(cli): improve how we handle duplicate channel addition

Open nichmor opened this issue 2 months ago • 2 comments

Overview

Running workspace channel add already-existing-channel-in-manifest, will always print that the channel is added, even if it was already there.

This change a little bit the UX ( and add a ReportOperation enum so we know for sure what we want to report.)

Uploading image.png…

nichmor avatar Oct 26 '25 19:10 nichmor

Just to double check - was pixid built in --release? It is a very strange slowdown. I will need to profile it.

nichmor avatar Oct 28 '25 10:10 nichmor

Sorry, that was indeed the reason 🙈

It's only marginally slower now:

nu ❯ hyperfine "pixid workspace channel add https://prefix.dev/conda-forge" "pixi workspace channel add https://prefix.dev/conda-forge"
Benchmark 1: pixid workspace channel add https://prefix.dev/conda-forge
  Time (mean ± σ):      94.7 ms ±   2.1 ms    [User: 72.9 ms, System: 52.7 ms]
  Range (min … max):    90.1 ms …  98.0 ms    30 runs

Benchmark 2: pixi workspace channel add https://prefix.dev/conda-forge
  Time (mean ± σ):      81.1 ms ±   1.3 ms    [User: 60.8 ms, System: 62.4 ms]
  Range (min … max):    78.3 ms …  84.1 ms    35 runs

Summary
  pixi workspace channel add https://prefix.dev/conda-forge ran
    1.17 ± 0.03 times faster than pixid workspace channel add https://prefix.dev/conda-forge

Hofer-Julian avatar Oct 28 '25 13:10 Hofer-Julian