Commit 414fc69
Optimize ArrowBytesViewMap insert_if_new with direct value access
Three optimizations for the BytesView hash map hot path:
1. Direct value bytes access: Replace values.value(i).as_ref() with
direct pointer arithmetic on input_views + input_buffers, avoiding
the GenericByteViewArray::value() accessor overhead on every hash
table probe for >12 byte strings.
2. Skip append for inline strings: For strings <=12 bytes, the input
view is self-contained. Instead of decoding to &[u8] and re-encoding
via append_value -> make_view, push the input view directly.
3. Simplify make_payload_fn: Change from FnMut(Option<&[u8]>) to
FnMut() since no caller uses the value bytes parameter. This
eliminates unnecessary value decoding on the insert path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7056098 commit 414fc69
2 files changed
Lines changed: 48 additions & 18 deletions
File tree
- datafusion
- physical-expr-common/src
- physical-plan/src/aggregates/group_values/single_group_by
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
269 | 298 | | |
270 | 299 | | |
271 | 300 | | |
| |||
279 | 308 | | |
280 | 309 | | |
281 | 310 | | |
282 | | - | |
| 311 | + | |
283 | 312 | | |
284 | 313 | | |
285 | 314 | | |
| |||
329 | 358 | | |
330 | 359 | | |
331 | 360 | | |
332 | | - | |
333 | | - | |
| 361 | + | |
334 | 362 | | |
335 | 363 | | |
336 | 364 | | |
| |||
339 | 367 | | |
340 | 368 | | |
341 | 369 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
347 | 382 | | |
348 | 383 | | |
349 | 384 | | |
| |||
726 | 761 | | |
727 | 762 | | |
728 | 763 | | |
729 | | - | |
730 | 764 | | |
731 | 765 | | |
732 | 766 | | |
733 | | - | |
734 | | - | |
735 | | - | |
| 767 | + | |
736 | 768 | | |
737 | 769 | | |
738 | | - | |
739 | 770 | | |
740 | 771 | | |
741 | 772 | | |
| |||
744 | 775 | | |
745 | 776 | | |
746 | 777 | | |
747 | | - | |
748 | 778 | | |
749 | 779 | | |
750 | 780 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
0 commit comments