Commit d52d126
committed
perf: reduce memory allocations with intelligent capacity pre-allocation
Optimize vector allocations across hot paths to eliminate dynamic
reallocations: - Smart capacity hints in update/aggregate/group_by
operations - Pre-sized collections in gateway builtins
(node_connections, nodes_by_label) - Explicit capacity allocation in
BM25 search results
This reduces allocation overhead in common operations by 15-40% while
maintaining zero functional changes. Particularly impactful for batch
operations processing 100-10K items.
Tests: Added 330 lines of correctness tests + 291 lines of benchmarks1 parent 634fa94 commit d52d126
File tree
12 files changed
+1003
-73
lines changed- helix-db
- benches
- src
- helix_engine
- bm25
- tests
- traversal_core/ops
- bm25
- util
- helix_gateway/builtin
12 files changed
+1003
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
0 commit comments