-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Summary
The hasEnabledComponents() and hasDisabledComponents() checks in GameObjectView.h perform hash lookups during iteration, which is expensive for large entity counts.
Problem
When filtering GameObjects by component state using GameObjectFilter::ComponentEnabled or GameObjectFilter::ComponentDisabled, the current implementation performs hash map lookups for each entity during iteration. This becomes a performance bottleneck in scenarios with many entities.
Proposed Solution
Consider one of the following approaches:
- Cache component enabled/disabled state directly on the
GameObjectas a boolean flag - Use a bitset or similar O(1) lookup structure instead of hash-based lookups
- Maintain separate lists for enabled/disabled components to avoid per-entity checks
Acceptance Criteria
- Component state checks during iteration are O(1)
- No regression in correctness of filtering behavior
- Benchmark comparison showing improvement for large entity counts
Reactions are currently unavailable