Reuse sandbox containers across build commands#127
Merged
Conversation
GuillaumeGomez
requested changes
May 13, 2026
Member
GuillaumeGomez
left a comment
There was a problem hiding this comment.
Just nits, the rest looks good to me, thanks!
GuillaumeGomez
approved these changes
May 14, 2026
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry, this is a bigger one. Happy to walk you through the ideas / changes, happy to discuss them.
Doing some tests I realised that only
docker createanddocker rmsometimes takes 5s, 10s, or 40s. Also very often it's <100ms).Docs.rs is running multiple commands:
for each target.
This leads me to the assumption that this could be a major reason why there is such a big difference between local host-builds and docs.rs container builds for the same crate. In some examples I checked the numbers roughly fit, #125 will give us more data when added to docs.rs & deployed.
Between these commands, we don't need a new container, we can just run more commands in the same container.
This refactors rustwide to make this possible. I think the new design is a better one, so I made this a breaking change.
The idea is:
SandboxBuilderjust creates theContainerContainerwe can thenrunone or more commands.The previous
ProcessStatisticshad to go too, and areSandboxStatisticsnow (= per-container, not per-command/call). Our source in docker is exactly that, and the API should reflect it. This is fine for the optimized docs.rs usage.testing