-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: create directories up front #533
perf: create directories up front #533
Conversation
This PR is still open because for @ruben-arts this was actually slowing down his installation. We still need to investigate more. |
@ruben-arts When you have some time shall we take another look at debugging this? I tested it this weekend and on windows this is a pretty big win. |
Here are some benchmarks from my windows machine:
|
Under WSL:
Looks like at least under WSL there is hardly any difference. |
On my windows machine:
|
On my windows machine with wsl
|
And for completeness on my linux beast:
|
## 🤖 New release * `rattler`: 0.25.0 -> 0.26.0 * `rattler_conda_types`: 0.23.1 -> 0.24.0 * `rattler_package_streaming`: 0.20.10 -> 0.21.0 * `rattler_networking`: 0.20.7 -> 0.20.8 * `rattler_lock`: 0.22.7 -> 0.22.8 * `rattler_repodata_gateway`: 0.20.1 -> 0.20.2 * `rattler_solve`: 0.22.0 -> 0.23.0 * `rattler_index`: 0.19.12 -> 0.19.13 * `rattler_shell`: 0.20.4 -> 0.20.5 * `rattler_virtual_packages`: 0.19.11 -> 0.19.12 <details><summary><i><b>Changelog</b></i></summary><p> ## `rattler` <blockquote> ## [0.26.0](rattler-v0.25.0...rattler-v0.26.0) - 2024-05-27 ### Fixed - improve progress bar duration display ([#680](#680)) ### Other - introducing the installer ([#664](#664)) - create directories up front ([#533](#533)) </blockquote> ## `rattler_conda_types` <blockquote> ## [0.24.0](rattler_conda_types-v0.23.1...rattler_conda_types-v0.24.0) - 2024-05-27 ### Added - removed Ord and more ([#673](#673)) - always store purls as a key in lock file ([#669](#669)) - add solve strategies ([#660](#660)) ### Fixed - make topological sorting support fully cyclic dependencies ([#678](#678)) </blockquote> ## `rattler_package_streaming` <blockquote> ## [0.21.0](rattler_package_streaming-v0.20.10...rattler_package_streaming-v0.21.0) - 2024-05-27 ### Other - introducing the installer ([#664](#664)) </blockquote> ## `rattler_networking` <blockquote> ## [0.20.8](rattler_networking-v0.20.7...rattler_networking-v0.20.8) - 2024-05-27 ### Other - introducing the installer ([#664](#664)) </blockquote> ## `rattler_lock` <blockquote> ## [0.22.8](rattler_lock-v0.22.7...rattler_lock-v0.22.8) - 2024-05-27 ### Added - removed Ord and more ([#673](#673)) - always store purls as a key in lock file ([#669](#669)) </blockquote> ## `rattler_repodata_gateway` <blockquote> ## [0.20.2](rattler_repodata_gateway-v0.20.1...rattler_repodata_gateway-v0.20.2) - 2024-05-27 ### Fixed - result grouped by subdir instead of channel ([#666](#666)) ### Other - introducing the installer ([#664](#664)) </blockquote> ## `rattler_solve` <blockquote> ## [0.23.0](rattler_solve-v0.22.0...rattler_solve-v0.23.0) - 2024-05-27 ### Added - removed Ord and more ([#673](#673)) - always store purls as a key in lock file ([#669](#669)) - add solve strategies ([#660](#660)) ### Fixed - result grouped by subdir instead of channel ([#666](#666)) ### Other - introducing the installer ([#664](#664)) </blockquote> ## `rattler_index` <blockquote> ## [0.19.13](rattler_index-v0.19.12...rattler_index-v0.19.13) - 2024-05-27 ### Added - always store purls as a key in lock file ([#669](#669)) </blockquote> ## `rattler_shell` <blockquote> ## [0.20.5](rattler_shell-v0.20.4...rattler_shell-v0.20.5) - 2024-05-27 ### Other - updated the following local packages: rattler_conda_types </blockquote> ## `rattler_virtual_packages` <blockquote> ## [0.19.12](rattler_virtual_packages-v0.19.11...rattler_virtual_packages-v0.19.12) - 2024-05-27 ### Other - updated the following local packages: rattler_conda_types </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/).
When linking packages a lot of time is spent creating directories as this flamegraph highlights:
Most of the time is spent checking if a directory (or its parents) already exists. However, we already know upfront all the directories that need to be created so why not do that? Well, say no more! That is exactly what this PR does!
New situation:
Its completely gone. Great success! 👍
In my preliminary dead simple benchmarks, this can easily save 20% of installation times.