Repository navigation
perf(editor): reuse display metadata when rebuilding type popups - #110
Merged
Merged
Conversation
Why Reopening a type selector repeats sorting, attribute lookup, path splitting, and label preparation even when its candidate snapshot has not changed. What Changed Prepare private display metadata once per popup snapshot and current culture, then build fresh dropdown items from it. Invalidate metadata on SetTypes or a culture change. Keep public AddTo sorting independently on every call. Add behavior tests for ordering, menu paths, snapshots, replacement, culture, mutable item isolation, public path isolation, and selection notifications. Impact Repeated popup rebuilds avoid redundant metadata work while preserving type filtering and public APIs. No generic support or shared mutable cache is added.
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
Reopening a type selector now reuses its sorted display metadata instead of repeating attribute lookups, path splitting, sorting, and label preparation. Each rebuild still creates fresh dropdown items.
The metadata belongs to one popup's candidate snapshot and is prepared lazily.
SetTypesand a change of the current culture invalidate it.Scope
AdvancedTypePopuponly in production code. Keep type discovery, eligibility filters, generic handling, Runtime, and public API signatures unchanged.AddTosorting on every call, stable ordering, menu paths and namespace flattening, input snapshots, mutable item isolation, and type/null selection notifications.Verification
Verificationpassed for commit871fa0d(PR run).Repeated
BuildRootmeasurements on macOS / Apple M1 Max, comparing main (6d034d5) with this change:Each subject used the same candidate arrays, with 51 samples per case after JIT warmup and alternating measurement order. Allocation capture ran separately and reports calibrated allocation event counts, not bytes. Names, hierarchy, IDs, and represented types matched main for Food, ITestBase, and object. The baseline popup/utility sources are byte-identical between
a746389and6d034d5.Fresh construction plus the first build, including metadata preparation, remained comparable: object medians were 12.1659 → 12.2912 ms on 2021.3 and 17.6828 → 17.6369 ms on 2023.2. These are local diagnostic observations, not timing thresholds in the test suite. The popup retains display metadata for reuse until its snapshot or culture changes.
References