Skip to content

What about pixi and rip? #1572

Closed
Closed

Description

@olivier-lacroix

Hello there,

I have been looking forward to improved package management for python, and am excited by the uv announcement. I have also been following with interest the developments made by the prefix team in pixi and rip.

Benchmarking uv with rip seems to show, anecdotally, that rip is as fast or faster than uv (I may be doing this completely wrong though):

❯ hyperfine --warmup 3 'cargo r install dagster /tmp/ripenv' 'source /tmp/uvenv/bin/activate;uv pip install --reinstall dagster --no-cache'
Benchmark 1: cargo r install dagster /tmp/ripenv
  Time (mean ± σ):      6.959 s ±  0.236 s    [User: 9.346 s, System: 0.370 s]
  Range (min … max):    6.643 s …  7.335 s    10 runs

Benchmark 2: source /tmp/uvenv/bin/activate;uv pip install --reinstall dagster --no-cache
  Time (mean ± σ):      7.829 s ±  0.819 s    [User: 0.808 s, System: 1.080 s]
  Range (min … max):    6.183 s …  8.809 s    10 runs

Summary
  cargo r install dagster /tmp/ripenv ran
    1.13 ± 0.12 times faster than source /tmp/uvenv/bin/activate;uv pip install --reinstall dagster --no-cache

Pixi and uv seem to have very similar goals (albeit pixi ambitions to cater to other languages than python).

I am wondering about the opportunities to share, at least, (some) underlying libraries to achieve these goals faster.

Activity

  1. added
    question
    on Feb 17, 2024
  2. zanieb commented on Feb 17, 2024

    @zanieb
    Member

    Hi!

    We've talked to each other before and there's definitely more that we can do together, but it's worth pointing out that there has already been collaboration — it's just not obvious.

    For example, they are using a couple foundational crates that @konstin published e.g.

    And we are using an HTTP crate from them:

    Additionally, all of our test scenarios have also been open source at packse long before we announced uv — they recently made use of a couple of these in their test suite. I'd love to see these test cases adopted across the Python packaging ecosystem, e.g. they would be useful to ensure behavior confirms in pip, poetry, etc.

    One barrier to collaboration is that they use a different resolver than us; they wrote resolvo but we are using PubGrub. These solvers have some fundamental differences, and during our design phase we decided to commit to PubGrub instead of a libsolv-style solver. However, we're working closely with the pubgrub-rs maintainers who have also expressed interest in working with their team:

    And work on pubgrub-rs has far reaching implications for resolvers across language ecosystems, e.g. the authors would love to see it used in Cargo some day:

    We have more crates in uv that we can publish for shared-use once we stabilize them, but everything is permissively licensed and open source.

    We're excited to have everything public now — it's going to make collaboration a lot easier.

    Regarding benchmarks, it's tough to create a robust benchmark. If you're interested in exploring it, I'd recommend adding rip support to our bench script.

  3. charliermarsh commented on Feb 17, 2024

    @charliermarsh
    Member

    Thanks, I appreciate this! Agree with everything @zanieb wrote above. We've chatted with various folks on the Prefix team at different points in time, and my feeling is that we just have different goals and focus areas (though with some overlap of course). But at the very least, there will still be opportunities for us to collaborate on some of the underlying libraries (like those mentioned above).

    On the benchmarks... Benchmarking is tricky. We put a lot of time into the benchmark script in the repo. As a heads up, the command above seems to be comparing rip with caching against uv without caching. (rip has a persistent cache, but doesn't currently expose command-line flags to modify it, based on my read.) I think it's also using a debug build for rip but a release build for uv. The details are hard to get right 😂

    I'm happy to produce some rigorous benchmarks if folks are interested -- we could probably add rip to our benchmark script. I just re-ran the command you used above, comparing release builds and clearing the cache between invocations:

    ❯ hyperfine --prepare "./target/release/uv venv" "./target/release/uv pip install -r requirements.in -n" --prepare "rm -rf ~/Library/Caches/rattler/pypi/ .venv" "../rip/target/release/rip install dagster .venv" --warmup 10 --runs 20
    Benchmark 1: ./target/release/uv pip install -r requirements.in -n
      Time (mean ± σ):      1.267 s ±  0.129 s    [User: 0.419 s, System: 0.807 s]
      Range (min … max):    1.070 s …  1.573 s    20 runs
    
    Benchmark 2: ../rip/target/release/rip install dagster .venv
      Time (mean ± σ):      3.379 s ±  0.244 s    [User: 0.851 s, System: 1.003 s]
      Range (min … max):    2.987 s …  3.927 s    20 runs
    
    Summary
      './target/release/uv pip install -r requirements.in -n' ran
        2.67 ± 0.33 times faster than '../rip/target/release/rip install dagster .venv'
    

    So that shows something like a > 2.5x speed-up with uv, but it'll vary across platform, machine, etc. (I took the median of three runs).

  4. olivier-lacroix commented on Feb 17, 2024

    @olivier-lacroix
    Author

    Thanks @charliermarsh and @zanieb !

    Started to add pixi in the bench script in #1581

  5. wolfv commented on Feb 17, 2024

    @wolfv
    Contributor

    Hey 👋

    Indeed, the differences are nicely pointed out by Charlie and Zanie and we're just as happy to collaborate on some of the underlying issues.

    I also did some benchmarking and indeed uv is a little faster, for the following reasons:

    • rip rigorously checks SHA256 hashes of the RECORD files inside packages, and uv seems to skip that. pip also skips that (which is why some Python packages actually ship with broken hashes)
    • rip's cache is currently storing wheels as zip files while uv stores the extracted files. This is something we need to change in rip, but shouldn't be particularly hard (we pay the cost of re-extracting the packages each install time). We also already do that for conda packages.
    • We check if new packages are on PyPI everytime instead of adhering to the 10 minutes Max-Age. This is behavior that we adopted from pip – we'll make this configurable in rip.

    And lastly rip and uv share some performance problems, e.g. urllib botocore is pretty tough to resolve.

    Anyways, as Charlie and Zanie mentioned we do share a bunch of underlying crates and hopefully we can share more going forward :)

  6. notatallshaw commented on Feb 17, 2024

    @notatallshaw
    Collaborator

    On the topic of resolver benchmarks, can I suggest that people take a look at the approach pip-resolver-benchmarks takes.

    My understanding is the library is experimental right now, but being able to collect full real world scenarios at a point in time and elliminate network variability (without just relying on cache) are both very helpful.

  7. zanieb commented on Feb 17, 2024

    @zanieb
    Member

    Thanks for the reference! That project inspired our packaging scenarios — we're very interested in being able to use those benchmark scenarios as inputs.

    And thanks for chiming in Wolf!

    Here are some issues regarding the behaviors mentioned:

  8. tekumara commented on Feb 18, 2024

    @tekumara

    we decided to commit to PubGrub instead of a libsolv-style solver

    just a question to satisfy my own intellectual curiosity around resolvers, what made you settle on PubGrub over libsolv or alternatives?

  9. JelleZijlstra commented on Feb 19, 2024

    @JelleZijlstra
    Contributor

    just a question to satisfy my own intellectual curiosity around resolvers, what made you settle on PubGrub over libsolv or alternatives?

    FYI Charlie talks about that here:

    https://discuss.python.org/t/uv-another-rust-tool-written-to-replace-pip/46039/56

  10. ruben-arts commented on Feb 21, 2024

    @ruben-arts
    Contributor

    Following up on @wolfv's response,

    We've decided to integrate uv into pixi to avoid double work and to be able to contribute to the same code base. This allows us to refocus on conda specific work. Killing rip as of immediately, but taking what we've learned and hopefully being able to support uv with it.

  11. zanieb commented on Feb 21, 2024

    @zanieb
    Member

    Thanks for the update! I'm going to close this as I think all the major questions here have been answered.

  12. EED85 commented on Mar 3, 2025

    @EED85

    Hi @ruben-arts,

    We've decided to integrate uv into pixi

    Did you have success?
    Our packages are built on a conda standard, and we're looking to expedite the creation of conda environments.
    Pixi with UV integrations seems very promising!

    This article sounds great: https://prefix.dev/blog/uv_in_pixi

  13. straygar commented on Mar 4, 2025

    @straygar

    @EED85 This is done, all [pypi-dependencies] are installed using uv.

  14. cesaryuan commented on Mar 15, 2025

    @cesaryuan

    @EED85 This is done, all [pypy-dependencies] are installed using uv.

    Is there a misspelling of [pypi-dependencies] here?

  15. straygar commented on Mar 15, 2025

    @straygar

    @cesaryuan yup, just fixed the typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions