Skip to content

refactor: tidy up perf pass#20

Merged
RostiMelk merged 1 commit intomainfrom
refactor/cleanup-perf-pass
Feb 7, 2026
Merged

refactor: tidy up perf pass#20
RostiMelk merged 1 commit intomainfrom
refactor/cleanup-perf-pass

Conversation

@RostiMelk
Copy link
Member

  • Hoist effectiveDensityFactor above the cache branch in useLogoSoup (was computed in both paths)
  • Drop INV_255 constant, inline the division in measure.ts
  • Rename threshSqcontrastDistanceSq for clarity on the * 3 derivation
  • Extract static inline style properties to module-level constants in LogoSoup.tsx

@vercel
Copy link

vercel bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-logo-soup Ready Ready Preview, Comment Feb 7, 2026 10:03am

Request Review

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Benchmark Comparison: main vs refactor/cleanup-perf-pass

Threshold: 5%+ change, >100us absolute delta, and statistically significant (p<0.05).

Benchmark main refactor/cleanup-perf-pass Change p-value Verdict
content detection (1 logo) 36.68 us 35.30 us -3.8% 0.501 unchanged
render pass (20 logos) 869 ns 957 ns +10.1% 0.001 ** unchanged
mount 20 logos (no detection) 3.20 us 3.37 us +5.5% 0.536 unchanged
mount 20 logos (defaults) 828.07 us 818.07 us -1.2% 0.297 unchanged

No regressions detected.

Feature cost breakdown

How expensive are individual features? Measured on this run's HEAD commit.

Feature On Off Cost Sig
densityAware: true vs false 32.07 us 32.54 us ~same 0.596
alignBy: visual-center-y vs bounds 1.14 us 57 ns 20× slower <0.001 ***
cropToContent: true vs false 2.15 ms 43 ns 2.15 ms <0.001 ***
layout update: full mount vs cached 824.03 us 1.75 us 470× slower <0.001 ***

Full benchmark output in the CI job logs.

@RostiMelk RostiMelk marked this pull request as ready for review February 7, 2026 10:05
@RostiMelk RostiMelk merged commit 8dc30f5 into main Feb 7, 2026
4 checks passed
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