Okay, so conda tried to install jupyter and I watched it spin for 40 minutes. Forty. Minutes. I made coffee, did laundry, called my mom. Still "solving environment."
The old conda solver was basically trying to solve a math problem every time you wanted numpy. Your innocent conda install numpy
would download like 200MB of package metadata, build some insane dependency graph, then try every possible combination until it either found a solution or I found a new career.
Here's what was happening under the hood (and why I wanted to throw my laptop):
- Download a metric fuckton of metadata - seriously, 100+ MB just for package lists
- Build dependency graph that probably has more connections than LinkedIn
- Try to solve it with PycoSAT which is... not fast
- When it fails (which it does), start completely over
That jupyter install? I timed it. 43 minutes and 12 seconds. I could've learned Go and built my own package manager in that time.
Then libmamba came along and unfucked everything
So conda 23.10.0 happened and they basically said "you know what, our solver is trash" and switched to libmamba. Turns out using the same libsolv that actual Linux distros use was a good idea. Who knew?
What changed:
- Solver written in C++ instead of Python (revolutionary concept, apparently)
- Proper caching so it doesn't re-download the internet every time
- Parallel processing because we don't live in 1995 anymore
- Actually remembers what it figured out yesterday
My jupyter install time? Went from 43 minutes to like 90 seconds. Still not as fast as pip, but I stopped considering alternative careers.
How fast is it now? (Spoiler: way better)
I tested this on my shitty 2020 MacBook Pro with 16GB RAM. Your experience will vary, but these numbers give you an idea:
Installing a basic data science stack (pandas, numpy, scikit-learn, jupyter):
- Old conda: 18 minutes (I timed it with a stopwatch because I was losing my mind)
- New conda with libmamba: About 3 minutes
- Raw mamba: Maybe 90 seconds
Trying to update a 6-month-old environment:
- Old conda: Usually just failed after 45 minutes
- New conda: Takes about 4 minutes and actually works
- Mamba: Fast enough I don't have existential crises
The conda survey said 60% of people bailed to mamba because of speed issues. I was one of them until the new solver came out.
Bottom line: conda used to be 6x slower than pip and now it's only like 2x slower. Progress!