Skip to content

Performance and diff2html API Rework#18

Merged
amadeus merged 8 commits intomainfrom
amadeus/diff-2-html-stuff
Oct 2, 2025
Merged

Performance and diff2html API Rework#18
amadeus merged 8 commits intomainfrom
amadeus/diff-2-html-stuff

Conversation

@amadeus
Copy link
Copy Markdown
Member

@amadeus amadeus commented Oct 2, 2025

This PR encapsulates a a bunch of changes that are connected yet disparate.

  • Fixed a few bugs with some of the diff file parsing based on Ed's monster PR patch file
  • A bunch of performance optimizations for pathologically large diffs
  • Started a round of proper configurability to diff rendering
  • Started work on a class for handling an entire file (that then wraps the DiffHunksRenderer)

* Renamed to DiffHunksRenderer (since it'll make sense as we roll out
  api updates)
* Added configurability to a bunch of the options
This is a foundation to base API in a somewhat similar way to diff2HTML.

This encapsulates some of the functionality that i was manually putting
together into main.

It also starts to productize the file based API a bit. Obviously next
steps would be a Diff class for full diffs, that could or could not
optionally render metadata and stuff.
@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 2, 2025

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

Project Deployment Preview Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Oct 2, 2025 0:49am
pierrejs-docs Ready Ready Preview Oct 2, 2025 0:49am

No point in loading the massive patch files for this demo app unless its
absolutely needed
export const DIFF_CONTENT_2 = diffContent2;
export const DIFF_CONTENT_3 = diffContent3;
export const DIFF_CONTENT_4 = diffContent4;
export const DIFF_CONTENT_5 = diffContent5;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Undoing the sins of my past here. No reason to bundle these in with the JS, should import() them, which now I do

Ensure we don't double fetch, no reason tbh
@amadeus amadeus merged commit 8cb2ff8 into main Oct 2, 2025
2 checks passed
@amadeus amadeus deleted the amadeus/diff-2-html-stuff branch October 2, 2025 00:49
SlexAxton added a commit that referenced this pull request Apr 21, 2026
Improves the packages/trees file-tree profiler startup path for large pre-expanded/open trees. The change stack removes redundant prepared-input validation, represents profiler workloads with initialExpansion: 'open', slims PathStore node/storage shapes, reduces cold startup writes, tunes visible-child chunk summaries, and removes redundant FileTreeView mount/render work.

Experiments: kept runs #1, #16, #18, #24, #25, #26, #28, #36, #41, #42, #43, #44, #51, #65, #67, #68, #71, #74, #80, #82, #137, #139, #140, #142, #143, #147, #149, #153, #155, #163, #165, #171, #180, #182, #186, #196
Metric: visibleRowsReadyMs 334.8ms -> 253.8ms best (-24.2%); final kept sample 267.8ms (-20.0%).
SlexAxton added a commit that referenced this pull request Apr 22, 2026
Improves the packages/trees file-tree profiler startup path for large pre-expanded/open trees. The change stack removes redundant prepared-input validation, represents profiler workloads with initialExpansion: 'open', slims PathStore node/storage shapes, reduces cold startup writes, tunes visible-child chunk summaries, and removes redundant FileTreeView mount/render work.

Experiments: kept runs #1, #16, #18, #24, #25, #26, #28, #36, #41, #42, #43, #44, #51, #65, #67, #68, #71, #74, #80, #82, #137, #139, #140, #142, #143, #147, #149, #153, #155, #163, #165, #171, #180, #182, #186, #196
Metric: visibleRowsReadyMs 334.8ms -> 253.8ms best (-24.2%); final kept sample 267.8ms (-20.0%).
SlexAxton added a commit that referenced this pull request Apr 22, 2026
)

Optimize file-tree startup for large open trees

Improves the packages/trees file-tree profiler startup path for large pre-expanded/open trees. The change stack removes redundant prepared-input validation, represents profiler workloads with initialExpansion: 'open', slims PathStore node/storage shapes, reduces cold startup writes, tunes visible-child chunk summaries, and removes redundant FileTreeView mount/render work.

Experiments: kept runs #1, #16, #18, #24, #25, #26, #28, #36, #41, #42, #43, #44, #51, #65, #67, #68, #71, #74, #80, #82, #137, #139, #140, #142, #143, #147, #149, #153, #155, #163, #165, #171, #180, #182, #186, #196
Metric: visibleRowsReadyMs 334.8ms -> 253.8ms best (-24.2%); final kept sample 267.8ms (-20.0%).
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