Repository navigation
Prune record-free applications from the relevant level's tree; cache paths and locations - #39
Merged
Merged
Conversation
…paths and locations The relevant level of list, hierarchical and detailed built the whole located tree and then left most of it out: hierarchical/list omit a unit with nothing to report and detailed condenses one away. to_render_node now takes prune_empty and, for that level, drops every application with no record at or below it (the root always remains), deciding bottom-up so a pruned application never materializes a location. The verbose level and trace still take the whole tree. The walk keeps two frames per level, which the assembly backstop test relies on. PathNode caches its materialized path and SchemaRef its location, both filled lazily on the frozen instance the way Cursor fills its pointer; a keyword's plain and fragment-encoded suffix is built once per name (output.keyword_suffixes) and shared by the unit renderers and the draft-03 tree. Documents are unchanged. Measured on CPython 3.12: relevant-level list 35-45% faster on large, mostly record-free evaluations (bench: compiled evaluator list 1.2-2.25x, interpreter list 1.07-1.43x ops/s across the corpora); verbose 16-20%. A third of a large verbose render is the cyclic collector, which the library leaves alone; DESIGN.md section 5 records both findings. One consequence: detailed through a compiled evaluator on a deep record-free chain now renders where the backstop used to raise. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
The relevant level of list, hierarchical and detailed built the whole located tree and then left most of it out: hierarchical/list omit a unit with nothing to report and detailed condenses one away. to_render_node now takes prune_empty and, for that level, drops every application with no record at or below it (the root always remains), deciding bottom-up so a pruned application never materializes a location. The verbose level and trace still take the whole tree. The walk keeps two frames per level, which the assembly backstop test relies on.
PathNode caches its materialized path and SchemaRef its location, both filled lazily on the frozen instance the way Cursor fills its pointer; a keyword's plain and fragment-encoded suffix is built once per name (output.keyword_suffixes) and shared by the unit renderers and the draft-03 tree. Documents are unchanged.
Measured on CPython 3.12: relevant-level list 35-45% faster on large, mostly record-free evaluations (bench: compiled evaluator list 1.2-2.25x, interpreter list 1.07-1.43x ops/s across the corpora); verbose 16-20%. A third of a large verbose render is the cyclic collector, which the library leaves alone; DESIGN.md section 5 records both findings. One consequence: detailed through a compiled evaluator on a deep record-free chain now renders where the backstop used to raise.