State Management Improvements

Originally published: 2026-09-21

The Decision

Best will cache the results of each test to a temporary file using mktemp and then print the results at the end.

The Context

Printing the results of each individual test to the terminal is slow. As the number of tests grows, the time it takes Best to run grows linearly.

Trade-offs

Alternatives Considered

The Consequences

Caching test results until the end and then printing all results at once results in a 59% performance improvement on average, with no observed downsides.

Reevaluate the decision if storing test results in memory proves to be faster or mktemp is discovered to not be as widely available as thought.