Skip to content

Add profiling script#48

Merged
trotzig merged 1 commit intomainfrom
claude/gracious-jemison
Mar 22, 2026
Merged

Add profiling script#48
trotzig merged 1 commit intomainfrom
claude/gracious-jemison

Conversation

@trotzig
Copy link
Copy Markdown
Contributor

@trotzig trotzig commented Mar 22, 2026

Summary

Adds profile.js — a script to benchmark imageDiff across all snapshot pairs. Run it with:

node profile.js

Baseline numbers (3 runs each, macOS)

Snapshot Min Median Mean Max Image sizes
long-example 2030ms 2038ms 2051ms 2085ms 1080×5485 / 1080×5678
tall-content-change-and-shift 867ms 869ms 873ms 883ms 1536×5000 / 1536×5000
dark-narrow-content-change-and-shift 214ms 237ms 235ms 253ms 390×5000 / 390×5000
different-widths 174ms 174ms 177ms 185ms 1280×720 / 1270×1811
blank-graph 114ms 127ms 143ms 188ms 1504×891 / 1504×891
large-tiny-text-change 86ms 86ms 86ms 87ms 1536×975 / 1536×975
removed-bottom-content 35ms 35ms 35ms 35ms 1908×234 / 1908×80
dark-text-change 17ms 17ms 17ms 17ms 686×428 / 686×428
removed-top-content 4ms 5ms 5ms 5ms 200×240 / 200×200
logo 1ms 2ms 2ms 2ms 64×64 / 80×80
Total (sum of means) 3624ms

Tall images dominate — long-example alone accounts for ~57% of total time, consistent with the LCS algorithm being O(n²) in image height.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread profile.js
main().catch(err => {
console.error(err);
process.exit(1);
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed this deeply.

@trotzig trotzig merged commit 3c76b09 into main Mar 22, 2026
1 check passed
@trotzig trotzig deleted the claude/gracious-jemison branch March 22, 2026 17:05
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