Repository navigation
Compute the Graph View's visible entities once per change - #2128
Merged
Merged
Conversation
This was referenced Aug 14, 2026
kmcginnes
force-pushed
the
graph-style-render-performance
branch
from
August 14, 2026 21:15
181ecfd to
d6bfe25
Compare
Layer: 1-canvas-pipeline
The old family was keyed on a freshly allocated id array, so every node-set change interned an entry nothing could reach again. The existing neighbor tests pin the behavior; retention itself cannot be asserted, because atomFamily exposes no size. Layer: 1-canvas-pipeline
The canvas map and the array hook went through a family keyed on a freshly allocated Vertex array, so every node-set change interned an entry nothing could reach again. The new tests pin the behavior and pass both before and after; retention itself cannot be asserted, because atomFamily exposes no size. Layer: 1-canvas-pipeline
kmcginnes
force-pushed
the
graph-style-render-performance
branch
from
December 1, 2026 19:00
f30b005 to
8dfa5bf
Compare
kmcginnes
marked this pull request as ready for review
December 1, 2026 19:00
kmcginnes
force-pushed
the
graph-style-render-performance
branch
2 times, most recently
from
December 1, 2026 22:04
b579e82 to
eeaae98
Compare
kmcginnes
added a commit
that referenced
this pull request
Dec 1, 2026
) ## Summary Editing one type's style built new style, type config, and display objects for every type in the schema. On a 10k-type schema that cost about 76 ms of store work per edit. **User-facing:** the Data Explorer's Display Name and Display Description selects show the attribute the table actually uses, as the node style dialog already does. Style edits on large schemas are faster. ```diff setVertexStyle(A) - vertexStyleAtom → new lookup; every type's resolved style is a new object - mergedConfigurationSelector → re-merges user styles into every type config, re-sorts - every displayVertexTypeConfigSelector, every displayVertexSelector re-runs + storedVertexStyleByTypeAtom(A) changes; every other type keeps its object + type configs come from the schema only; user styles are read per type at display time + display type config rebuilds only when its type's display label changes + displayVertexSelector / displayEdgeSelector keyed on VertexId / EdgeId ``` ## Evidence **Before:** a single color edit invalidated every per-type atom. In the picker trace, Jotai's store update took 76 ms per commit. **After:** new identity tests check that editing type A leaves type B's resolved style, type config, display config, and display vertex the same object. "ignores a display attribute stored on the schema" pins the Data Explorer selects. Display entities on the canvas keep their identity when another type's style changes, so the canvas elements are no longer rebuilt for an untouched type. The family-key tests check that replacing a vertex or edge with the same id adds no new cache entry. With the whole stack applied, the store update in the same trace dropped to 37 ms per commit. **Verified live:** agent-tested in Chrome against 10,001 vertex and 10,001 edge types. Picking `code` in the Data Explorer's Display Name select stored it in the user style and relabeled the hub on the canvas. ## Merge Danger **Door:** two-way. Stored styles keep their shape. **Impact:** display. Every vertex and edge label and type label reads styles per type now. `mergeEdge` drops the legacy rewrite of an edge `displayNameAttribute` from `"type"` to `"types"`. Old state survives: on `main`, nothing read the patched value. Edge labels already read the resolved style, which never had the patch. Exported connection files no longer include user styles in their schema entries. Since v2.5.0, import has ignored styles in the file, because the canvas reads only stored user styles. Only v2.4.0 and older apply styles from a file, so a file exported from this build shows default styles there. ## Upgrade Notes - **The Data Explorer's Display Name and Display Description selects on SPARQL connections can show a different attribute.** The selects used to show the schema's guessed attribute. They now show the attribute the table renders. Nothing to do unless you want a different one. ## Related - Related to #2116: rekeys `displayEdgeSelector` and `displayVertexSelector` on ids, so search results and the `useDisplayVertex` fallback no longer leave a cache entry behind on every render - Stacked on #2128 --- <sub>🤖 Written by an AI agent on my behalf.</sub>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every expand recomputed the visible vertices twice and added a cache entry that nothing could reach again.
User-facing: nothing looks different. Each expand does one pass instead of two and leaves no cache entry behind.
Evidence
The visibility filter now reads raw node and edge state, so a style edit no longer re-runs it. Display entities for the types on the canvas are still rebuilt on a style edit. The next PR in the stack stops that for every type except the one edited.
Verified live: agent-tested in Chrome against a local Gremlin Server with 10,001 vertex and 10,001 edge types, expanding a hub to 76 nodes. Post-GC heap grew about 0.3 MB per clear-and-expand cycle over 10 cycles and leveled off. Timings for the whole stack are in the PRs stacked above.
Merge Danger
Door: two-way. No saved data or config changes shape.
Impact: rendering. Every Graph View render goes through the shared visible-entity atoms.
Related
atomFamilysites (displayVerticesSelectorandallFetchedNeighborsSelector)🤖 Written by an AI agent on my behalf.