Improve preview speed#8750
Open
ClementPasteau wants to merge 5 commits into
Open
Conversation
These synthetic benchmarks complement scripts/profile-events-code-generation.js (which profiles a real project) by isolating how resource finding and events code generation scale with project size, making perf regressions easy to spot. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pe caches Introduce gd::PlatformMetadataIndex, a hash-map index of all metadata declared by a platform's extensions, built lazily and owned by gd::Platform. It is discarded whenever extensions change (Platform::AddExtension / RemoveExtension, which also covers replacement/regeneration), so it never returns stale metadata. Lookup semantics are unchanged (first extension wins; object/behavior expressions resolve the specific type before the base). This replaces the per-code-generation caches added earlier: - the object-metadata cache is now redundant (MetadataProvider is O(1)); - the object-type cache only helped pathological object groups and had no measurable effect on real projects, so it is removed for simplicity. Fixing the lookup at the source instead measurably speeds up resource finding (per-instruction metadata lookups) and any project with many extensions, where the previous O(extensions) scan grew without bound. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Core/tests/PlatformMetadataIndex.cpp (native/catch): every lookup kind against
DummyPlatform, object-expression fallback to the base ("") type, behavior
actions indexed alongside free/object ones, bad-metadata for unknown types,
the declaring extension is returned, and the index rebuilds after an extension
is removed.
- Expand the jest MetadataProviderIndex test to assert *all* metadata kinds
resolve after an extension is added and *all* become bad after it is removed
(invalidation covers the whole index, not just objects/actions).
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
No description provided.