Repository navigation
Conversation
Snapshot of a large table spends most of its time in Accessibility.getFullAXTree: Chrome serializes the whole tree, 5.7 MB and 13,033 nodes for a 500 row table. The client then parsed that payload twice, once into a serde_json::Value in the reader and again into the typed struct. Responses that a caller registered for raw delivery now skip the Value parse. The reader reads the leading "id" of the frame, which is available before the payload, and hands the text to the waiting send_command_typed_raw caller. Frames that do not lead with an id, malformed frames and lone surrogate escapes go through the same handling as the shared reader. compact_tree marked ancestors by walking back over every earlier line for each kept line, which is quadratic in the number of snapshot lines and cost 3.5 s on a 2,000 row table. It now keeps the open ancestors on a stack. A 500 row snapshot goes from 730 ms to 575 ms median wall time and a 2,000 row one from 3,110 ms to 2,519 ms; with --compact the 2,000 row page goes from 6,618 ms to 2,550 ms. Snapshot output, including refs, is byte identical on all fixtures in all modes.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
lahfir
reviewed
Nov 9, 2026
| let _ = self.socket.shutdown(Shutdown::Both); | ||
| Self::abort_task(&self.reader_handle).await; | ||
| self.pending.lock().await.clear(); | ||
| self.raw_pending.lock().await.clear(); |
Contributor
There was a problem hiding this comment.
what if we add lifecycle tests for send_command_typed_raw too? the existing close test only exercises pending, so a regression in raw_pending cleanup could leave snapshots waiting for the 30-second timeout without failing that test. i checked close, reader EOF, cancellation and post-close rejection with temporary probes and they all passed; keeping those cases in the suite would guard that behavior.
lahfir
approved these changes
Nov 9, 2026
This branch was successfully deployed
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.
Accessibility.getFullAXTreeresponse directly into the typed struct instead of through an intermediate JSON value, so multi megabyte responses are parsed once.--compactlinear on large tables.