perf: replace arrays with Maps in AnimationInputs for O(1) lookups#413
Merged
stormmuller merged 2 commits intotests-animation-inputsfrom Jan 1, 2026
Merged
Conversation
Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace textInputs, numberInputs, and toggleInputs with maps
perf: replace arrays with Maps in AnimationInputs for O(1) lookups
Jan 1, 2026
stormmuller
added a commit
that referenced
this pull request
Jan 1, 2026
* refactor: consolidate TODO comments for AnimationInputs tests * refactor: update TODO comments for performance optimization in AnimationInputs * refactor: remove redundant warning when adding existing systems and update TODO for system identification * perf: replace arrays with Maps in AnimationInputs for O(1) lookups (#413) * Initial plan * perf: replace arrays with Maps in AnimationInputs for O(1) lookups Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> * Add tests for trigger inputs and default values in AnimationInputs (#412) * Initial plan * test: add comprehensive tests for trigger inputs and default values Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> * feat: use System instances as map keys for reliable system tracking (#414) * Initial plan * feat: add unique ID to System class using symbol-based pattern Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> * refactor: add SystemCtor type for better type safety Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> * refactor: use System instances as map keys instead of symbol IDs Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com> * refactor: remove unused material classes and update exports in materials index --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.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.
Replaced array-based storage with Map-based storage in
AnimationInputsto eliminate O(n) lookups. The class used arrays with.find()for retrieving inputs by name, which degrades as input count grows.Changes
textInputs,numberInputs,toggleInputs,triggerInputsfromAnimationInput<T>[]toMap<string, AnimationInput<T>>_registerInput:array.some()→map.has(),array.push()→map.set()_getInput:array.find()→map.get()update: iterate viatriggerInputs.values()instead of direct array iterationImpact
Public API unchanged. All lookups now O(1) instead of O(n).
Original prompt
Created from VS Code via the GitHub Pull Request extension.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.