Read an element's label and value without expanding the array - #55
Merged
Merged
Conversation
MAX_EXPANDED_ELEMENTS stops a 1000x1000 double from becoming a million table rows, which is right for the table and wrong for everything else: the only channel a consumer had for element-by-element display text was the child nodes, so capping expansion took the Variable Editor grid's data with it. displayElements() is that channel as an accessor over `_elements`. Where the children exist they ARE the answer, so the two paths cannot drift; where they do not, one re-seeded scratch node formats each element through the same getter a child would have used, allocating nothing per element beyond the answer. `_elementType` is now recorded before the cap guard, because a complex array is the one shape whose element class cannot be inferred from the container. Also closes two holes in the cap itself. The structured `_array_type: 'String'` parse and the bare JSON list of strings each built their element children with an inline loop instead of calling _buildStringChildren, so a 10,000-element string array expanded in full from those two spellings while the identical array written as an inline literal did not. Both go through the choke point now.
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.
MAX_EXPANDED_ELEMENTSstops a 1000x1000 double from becoming a million table rows. That is right for the table and wrong for everything else: the only channel a consumer had for element-by-element display text was the child nodes, so capping expansion took the Variable Editor grid's data with it.displayElements()is that channel as an accessor over_elements:test/displayElements.test.tspins the agreement between the paths rather than either one alone.<unavailable>sentinel stay single-sourced. Allocates nothing per element beyond the answer.nullfor a kind with no elements;[]for an array with none._elementTypeis now recorded before the cap guard, because a complex array is the one shape whose element class cannot be inferred from the container (_scalarTypeisdouble; the elements arecomplex).Also closes two holes in the cap itself. The structured
_array_type: 'String'parse and the bare JSON list of strings each built their element children with an inline loop instead of calling_buildStringChildren, so a 10,000-element string array expanded in full from those two spellings while the identical array written as an inline literal did not. Both go through the choke point now, andlargeArrayNotExpanded.test.tswould notice a fourth spelling arriving with its own loop.npm run verifygreen: 5136 tests.