Skip to content

Conversation

@nichmor
Copy link
Contributor

@nichmor nichmor commented Oct 26, 2025

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…

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

With this change, the command becomes noticably slower on my machine:

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 ± σ):     790.4 ms ±  14.5 ms    [User: 789.8 ms, System: 60.2 ms]
  Range (min … max):   772.1 ms … 821.9 ms    10 runs

Benchmark 2: pixi workspace channel add https://prefix.dev/conda-forge
  Time (mean ± σ):      78.8 ms ±   0.9 ms    [User: 62.6 ms, System: 59.4 ms]
  Range (min … max):    76.5 ms …  81.0 ms    37 runs

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

@nichmor
Copy link
Contributor Author

nichmor commented Oct 28, 2025

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

@Hofer-Julian
Copy link
Contributor

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

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Just one small comment, apart from that it looks good! Thanks Nichita!

Comment on lines +51 to +59
#[derive(strum::Display, strum::EnumString)]
enum ReportOperation {
#[strum(to_string = "Added")]
Add,
#[strum(to_string = "Removed")]
Remove,
#[strum(to_string = "already exists")]
AlreadyExists,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like, this would be clearer without strum and by just adding the text to operation_text.

@lucascolley lucascolley added cli Issue related to CLI UX Related to the User Experience of pixi labels Oct 29, 2025
@lucascolley lucascolley changed the title chore: improve how we handle duplicate channel addition chore(cli): improve how we handle duplicate channel addition Oct 29, 2025
@lucascolley lucascolley added the area: workspace Related to pixi workspace label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: workspace Related to pixi workspace cli Issue related to CLI UX Related to the User Experience of pixi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants