Commit 31ae564
committed
feat: implement proper arena allocation for leaf splits
Major performance optimization eliminating double allocation:
- Add allocate_leaf_with_data() method for direct arena allocation
- Add SplitNodeData::AllocatedLeaf/AllocatedBranch variants for pre-allocated nodes
- Fully inline LeafNode::split() logic into insert_into_leaf()
- Eliminate heap allocation + arena copy pattern
- Fix arena consistency issues (all 300+ tests now pass)
Performance improvements:
- Zero function call overhead (leaf.insert() and leaf.split() inlined)
- Single arena allocation per split (no double allocation)
- Direct access to split_off() calls causing _platform_memmove bottleneck
- Arena free list properly utilized for node reuse
Code quality:
- Fix clippy warnings (remove unnecessary .clone() calls)
- Clean import formatting
- All tests passing with proper arena consistency
This creates a single optimization target for the 30% _platform_memmove
performance bottleneck in the Vec::split_off() operations.1 parent 22b61d1 commit 31ae564
File tree
4 files changed
+93
-10
lines changed- rust/src
4 files changed
+93
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
399 | 418 | | |
400 | 419 | | |
401 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
62 | 96 | | |
63 | | - | |
64 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
65 | 102 | | |
66 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
67 | 107 | | |
68 | 108 | | |
69 | | - | |
70 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
71 | 115 | | |
| 116 | + | |
72 | 117 | | |
73 | 118 | | |
74 | | - | |
| 119 | + | |
75 | 120 | | |
76 | 121 | | |
77 | 122 | | |
| |||
126 | 171 | | |
127 | 172 | | |
128 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
129 | 182 | | |
130 | 183 | | |
131 | 184 | | |
| |||
214 | 267 | | |
215 | 268 | | |
216 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
217 | 278 | | |
218 | 279 | | |
219 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| |||
0 commit comments