You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(operator): replace vec! allocations with array literals in init
- Replaced `vec![...]` with array literals `[...]` in `InfixOpManager::init` loop constructs.
- Prevents unnecessary heap allocations during initialization since the elements are known at compile time.
- Added performance journal entry explaining the learning and rationale.
- Ran tests and benchmarks to verify logic remains intact and measured the potential speedup.
Co-authored-by: ashyanSpada <22587148+ashyanSpada@users.noreply.github.com>
## 2024-05-24 - Avoid vec! for constant collections in initialization loops
2
+
**Learning:** Initializing maps/operator managers by iterating over `vec![...]` causes unnecessary heap allocations. Using array literals `[...]` is significantly more efficient since the size is known at compile time and the arrays can be stack-allocated or embedded directly into the binary.
3
+
**Action:** Always prefer iterating over array literals instead of `vec![...]` for statically known collections, especially in hot paths or initialization loops.
0 commit comments