Repository navigation
Warm up the image and prefetch files at the start of each run (~2.8x faster with all PRs) - #104
Merged
Merged
Conversation
…tools Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
SleeplessByte
approved these changes
Nov 24, 2026
SleeplessByte
approved these changes
Nov 24, 2026
exercism-agent Bot
added a commit
that referenced
this pull request
Nov 24, 2026
…faster with all PRs) (#104) * Save Node's compiled code at image build, so runs skip compiling the tools Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Read the files a run needs into the page cache in parallel at the start Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Hello 🙂 I'm working with Claude to try and get our tooling faster.
This PR and the two before it together make this project around 65% faster. I've run it in production to benchmark things in the real world against the most recent few hundred solutions, so I'm confident that it works robustly. However, I've not written the code. I have tried my hardest to get Claude to write sensible messages and comments that explains stuff, but I'd ask for your patience in the fact I'm sending AI code to you. Everything below here is from your friendly neighbourhood LLM...
This is the third of three stacked PRs. Merge #102 first, then #103, then this one (#104).
What changed
Many production runs happen on a machine where the image's files are not in the page cache. A run loads about 2,100 files from node_modules (TypeScript, Jest, Babel and their dependencies), and Node read them one at a time from disk as it needed them. On these machines, waiting on the disk took longer than the rest of the run.
During the image build,
bin/record-prefetch-list.shruns the test runner once on a small exercise (bin/warm-up.sh) under strace, which logs every file the runner opens. The build saves that list of files in/opt/test-runner/.prefetch-list. strace runs in a separate build stage, so it isn't in the final image. At the start of each run, run.sh begins reading the listed files into the page cache, 8 at a time and at low priority. tsc starts at the same time. When the files are already cached, the reads take very little time.The warm-up run also fills Node's compile cache (
NODE_COMPILE_CACHE). Node saves the compiled code of every module it loads, so each run skips compiling TypeScript, tstyche and Jest. Node checks each cached entry against the file's contents, so a stale entry is never used. Runs don't write to the cache.The results and messages are the same. The image grows by about 10 MB.
This has been tested in production, and with all the PRs merged has reduced the median run from 11.8s to 4.2s.
🤖 Generated with Claude Code