Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- **A cold launch's setup pass starts one shell, not one per stage.** Each stage (session
name, zellij, codex, title, onboarding, trust) ran in a nested `bash -c`, and every new
bash reads the image's `$BASH_ENV`. An image that points it at a heavy shell profile
(for example a ROS environment) can pay about 1.1s a read inside `devpod ssh`, so the
trip took about 11s. The stages now run in subshells of the pass
(`( eval '<script>' )`), which keep each stage's `exit`, `set -u` and parse errors to
itself as the nested bash did. Measured over six cold launches of such an image, the
setup trip went from 10.9s to 11.1s down to 6.7s to 6.9s.

## [0.60.0] - 2026-10-16

### Added
Expand Down
19 changes: 19 additions & 0 deletions docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,25 @@ failing. A master that has gone away leaves a socket the next client unlinks, an
resident `devpod ssh --stdio` process and a `docker exec` per key, and `dl` must
not be the reason a container never goes idle.

## One shell for the setup pass

A cold launch sends one `devpod ssh --command` trip that runs dl's setup stages
and then the tools probe. Each stage runs in a subshell of that trip's shell, not
in a `bash` of its own. The reason is `$BASH_ENV`: every new non-interactive bash
reads it, and an image may point it at a heavy shell profile (for example a ROS
environment). On the image measured below, one read inside a `devpod ssh`
session costs about 1.1s.

Measured on 2026-10-12, on one host with the local docker provider and devpod
0.26.3, over six cold launches of a large ROS repository whose image sets
`$BASH_ENV`, on six fresh branches. With a `bash -c` per stage the trip took
10.90s to 11.14s. With subshells it took 6.66s to 6.90s, so about 4.2s comes
off every cold launch of that repo. The saving on an image with no `$BASH_ENV` is not measured. It should
be the cost of starting a bash per stage, which is small. A warm launch makes no setup trip, so it is not affected.

`the_pass_reads_the_images_bash_env_once_however_many_stages_it_runs` and
`dl/tests/setup_pass_shells.rs` pin the count at one read per pass.

## Measuring launch time

Set `DEVLAUNCH_TIMING=1` and a `dl` command ends with one summary on stderr,
Expand Down
Loading
Loading