Skip to content

fix(editor): reuse class usage across unchanged page trees - #583

Draft
marcodantonio-netsons wants to merge 1 commit into
CoreBunch:mainfrom
marcodantonio-netsons:fix/editor-large-site-class-usage
Draft

marcodantonio-netsons wants to merge 1 commit into
CoreBunch:mainfrom
marcodantonio-netsons:fix/editor-large-site-class-usage

Conversation

@marcodantonio-netsons

Copy link
Copy Markdown

Loading a large site streams collaborative row projections into the editor. Each projection previously rescanned all page and component nodes for canvas CSS and selector badges, even when almost every tree was unchanged. Cache class references by immutable tree identity and keep badge counts stable across edits that do not change class assignments. The publisher retains its uncached collector for mutable construction.

Verified with bun test (7,056 tests), bun run build, bun run lint and git diff --check. Regression tests cover changed and unchanged trees, removal/reload, duplicate references, components and script-referenced classes. On a local 1,602-page / 754-component site with 555,054 native nodes, 30 row projections took 1,188 ms for the previous signature scan versus 459 ms for the cached signature plus usage counts. This addresses class scanning; full editor startup performance is still being investigated. No database schema changes.

This branch has not been deployed

No deployments
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