Skip to content

Batch test watches.#6197

Draft
ChrisPenner wants to merge 2 commits intotrunkfrom
cp/batch-test-watches
Draft

Batch test watches.#6197
ChrisPenner wants to merge 2 commits intotrunkfrom
cp/batch-test-watches

Conversation

@ChrisPenner
Copy link
Copy Markdown
Member

@ChrisPenner ChrisPenner commented Mar 19, 2026

Overview

Folks in Discord noticed that the test helper is much slower when running many tests than just loading all those tests into a single scratch file and running them there.

A look under the hood revealed we were creating an independent Unison File and runtime kick-off for each test independently; which meant a lot of duplicated overhead; and meant we were loading a lot of the same dependent code multiple times.

Instead we can create a single virtual Unison File with many Test Watches in it, run them all in one go; this is much faster.

  • TODO: Running them this way is much faster, but of course we don't get dynamic updates when we run them all at once, so will need to figure that out yet.

For a project like typed-json; running debug.clear-cache and then test goes from 104s -> 30s

Implementation approach and notes

How does it accomplish it, in broad strokes? i.e. How does it change the Haskell codebase?

Interesting/controversial decisions

Add batch versions of the unison Term evaluation functions, these load many terms into the runtime as watches all at once, execute them in a single go, then unpack the results back into a map.

Test coverage

TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant