perf: increase diff and startup speed#4
Merged
Conversation
Polls localhost:1337 every 20ms instead of always waiting 100ms. Fast machines proceed as soon as the server is up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously --update had no effect on the diff phase — it still ran full comparisons. Now copies all snapshots to baselines in parallel and returns early, skipping the diff entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two changes to the diff loop: - Use image::load_from_memory instead of image::open so PNG bytes already read for byte-comparison are reused, halving disk reads for non-identical pairs. - Two-pass pixel comparison: pass 1 counts differing pixels with no allocation; pass 2 builds the RGBA diff image only for stories that fail the threshold. Passing stories (the majority) skip ~5MB of buffer allocation and pixel work entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
image::load_from_memoryin diff phase — PNG bytes already read for byte-equality check are reused for decoding, eliminating 2 disk reads per non-identical image pair--updateflag — previously had no effect on the diff phase; now copies snapshots to baselines in parallel and skips diff entirelyCommits
perf: replace fixed server sleep with readiness probefix: handle --update flag in diff stepperf: eliminate double disk reads and skip diff image alloc on passTest plan
--update, verify baselines are updated and no diff runs🤖 Generated with Claude Code