Guides

Making checks fast

What decides how long a check takes, and the three changes that help most.

What a check costs

Starting a check takes about a second. After that, a check takes as long as the test commands it has to run. A command is skipped when nothing it read changed, so the less each command reads, the less a change reruns.

Keep setup to dependencies

If .land/setup.sh installs your project itself, for example with pip install -e ., every change to your source rebuilds the environment and reruns everything. Install only the dependencies, and let the tests import your code from the repository.

Split the suite

With one command for the whole suite, any change reruns all of it. With one command per area, a change to the API reruns only the API tests.

land add \
  --test 'core=python -m pytest -q -n auto tests/core' \
  --test 'api=python -m pytest -q -n auto tests/api'

Use every CPU

A check gets 4 CPUs by default. Run your tests in parallel, for example with pytest-xdist's -n auto, or your test runner's own workers. For pytest, --dist worksteal also helps when a few tests are much slower than the rest.

The first merges

After land add, land records what each test command reads, in the background. Until that finishes, every merge runs every command. Running land add again answers at once and says whether the recording is done.

Merges are correct while the recording runs, only slower. See Limits for when skipping can't help.