Skip to content

Conversation

@DoneDeal0
Copy link
Owner

@DoneDeal0 DoneDeal0 commented Jan 10, 2026

BOOST PERFORMANCE OF getObjectDiff & getListDiff

  • Rewrote getObjectDiff and getListDiff for maximum performance.
    Due to aggressive optimizations, the code is less readable, but the performance gain justifies the tradeoff.

  • Added a benchmark comparing Superdiff with its main competitors.

  • Updated several dev dependencies.

📊 BENCHMARK

Environment: Node.js 24.12.0 (LTS) • MacBook Pro M2 (2023, Sequoia 15.1) • 16GB RAM.

Method: Warm up runs, then each script is executed 20 times, and we keep the median time. To minimize garbage collection and cross‑benchmark interference, all scenarios are run individually. All benchmark scripts are included so you can reproduce the results locally.

List diff

Scenario Superdiff arr-diff deep-diff
10k items array 1.84 ms 32.95 ms 4.74 ms
100k items array 17.43 ms 3363.15 ms 50.36 ms

Object diff

Scenario Superdiff deep-object-diff deep-diff
10k flat object keys 2.27 ms 2.44 ms 39.37 ms
100k flat object keys 29.23 ms 31.86 ms 3784.50 ms
100k nested nodes 4.25 ms 9.67 ms 16.51 ms

👉 Despite providing a full structural diff with a richer output, Superdiff is the fastest. It also scales linearly, even with deeply nested data.

@DoneDeal0 DoneDeal0 self-assigned this Jan 10, 2026
@DoneDeal0 DoneDeal0 force-pushed the boost-perfs branch 2 times, most recently from 36f6a40 to ce2f0e9 Compare January 10, 2026 20:19
@DoneDeal0 DoneDeal0 marked this pull request as ready for review January 11, 2026 11:01
@DoneDeal0 DoneDeal0 changed the title feat: boost perfs feat: boost performance of getObjectDiff and getListDiff Jan 11, 2026
@DoneDeal0 DoneDeal0 merged commit 9888f54 into master Jan 11, 2026
1 check passed
@DoneDeal0 DoneDeal0 deleted the boost-perfs branch January 11, 2026 11:11
@github-actions
Copy link

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants