jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
7.83k stars 187 forks source link

[perf] Install all packages to profile in a single nix command #2130

Closed mikeland73 closed 3 weeks ago

mikeland73 commented 3 weeks ago

Summary

This change installs all packages into profile with same command. If we fail due to priority conflict, we fallback to the previous one by one installation.

This significantly improves performance on projects with many packages when all packages are already in store. This aims to solve a common CICD case where nothing has changed, all packages are in store, but we need to create the .devbox directory and nix profile from scratch.

cc: @Lagoja this helps address some reported issues.

How was it tested?

Happy path: On project with 30+ packages, delete .devbox directory and ran devbox install. This change reduced total time from 10s to 2s.

Sad path: On new project added curl, ruby, bundler, go. ruby and bundler conflict. I ran devbox install and it correctly fell back to one by one. I inspected the profile to ensure nix did not install anything twice.

sentry-io[bot] commented 1 week ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎