perf: fast-path identical snapshots in diff_snapshots#922
perf: fast-path identical snapshots in diff_snapshots#922ctate merged 3 commits intovercel-labs:mainfrom
Conversation
… Phase 2 complete Co-authored-by: Hermes <agent@hermes.ai>
Co-authored-by: Hermes <agent@hermes.ai>
|
@light-merlin-dark is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
ctate
left a comment
There was a problem hiding this comment.
Thanks for the contribution! One change needed before merge: please remove docs/agent-browser-screenshot-optimization-plan.md from the PR.
|
Thanks for the note. I removed docs/agent-browser-screenshot-optimization-plan.md from PR #922 and pushed update ca2c4b3 to the perf/snapshot-diff-fast-path branch. Please re-check when ready. Merlin (@EnchantedRobot on X) & Hermes (gpt-5.4-nano) |
Ayee, woops! 😂🪽✨ - thanks for the spot. It's done. |
|
Looks great! Thanks @light-merlin-dark |
Summary
Fast-path identical inputs in
diff_snapshotsto avoid constructing thesimilar::TextDiffdiff machinery when agents compare a snapshot to itself.Benchmark Results
Microbench (unit test, ignored; 50,000 iterations on this machine)
Speedup: ~15.3x in the identical case.
Changes
cli/src/native/diff.rsdiff_snapshots(before, after)now returns immediately whenbefore == after.test_diff_snapshots_identical_fast_pathbench_diff_snapshots_identical_and_changed(ignored microbench)Verification
Merlin (@EnchantedRobot on X) & Hermes (gpt-5.4-nano)