Repository navigation
perf(server): a product's node drawn without the passes of a graph, and its args kept fast - #285
Merged
Merged
Conversation
…nd its args kept fast
A product draws each of its nodes with `stockNode`, through the graph
source's pass over a document of that one node: 8,000 operations in
mlir-viewer are 8,000 passes the first time a file is drawn, and every
later drawing copies each node's args. Measured on mlir-viewer's
8,000-operation test, with its part of the change: the first drawing
from about 1,060 ms to about 815 ms, a drawing again from about 490 ms
to about 368 ms.
- `transform(doc, { oneNode: true })`, which `stockNode` asks for, does
not run the passes over a graph's edges and groups (feedback, edges
cut at groups, rows, frames): a document of one node has none. A test
holds that the node is drawn the same either way, one that opens too.
- `markFeedbackEdges` indexes no port when a graph has no edge.
- `stockNode` leaves out the document's scope and the stand-in for what
the node holds by a copy, not a `delete`: an object a key is deleted
from is slow to read and to copy, and the product copies these args
each time it draws the node.
Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
…o edge From the review of #285: `oneNode` was the caller's word alone. It is not taken when the document has an edge or another node, or the reader's choices may open the node, and a test holds that a document of two nodes on a loop has its edges marked as ever. The comment in `markFeedbackEdges` no longer names a pass that does not reach it. Claude-Session: https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya
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.
A product draws each of its nodes with
stockNode, which runs the graph source's pass over a document holding that one node. In mlir-viewer, 8,000 operations mean 8,000 such passes the first time a file is drawn, and every later drawing copies each node's args.What changes
transform(doc, { oneNode: true }).stockNodeasks for it, and it skips the passes over a graph's edges and groups: feedback, edges cut at groups, group rows and frames. A document of one node has none of these, so the passes would find nothing to do.markFeedbackEdges. It indexes no port when the graph has no edge, which helps any graph without edges.stockNodeargs. The document's scope and the stand-in for what an openable node holds are now left out by building a copy, not bydelete. V8 makes an object with a deleted key slow to read and to copy, and the product copies these args every time it draws the node.Measured
mlir-viewer's 8,000-operation timing test, with its part of the change (mlir-viewer PR to follow):
The two parts were also timed separately, on one core, with a bundle of the same build. The
deleteis the largest single item: about 75 ms on a redraw and 125 ms on a first draw. The skipped passes save about 70 ms on a first draw.Tests
oneNodeis identical to the full pass's drawing, for a plain node and for one that opens.https://claude.ai/code/session_011UYzzShRuBLgefHUrAbqya