Commit 27576c9
feat(memory): Introduce a pluggable mem-buffer mechanism and an optimized staging buffer impl (#564)
### Description
Resolves [issues-546](#546) .
This PR introduces a pluggable mem-buffer mechanism, and based on this, this also introduces a optimized staging lookup implementaion of mem-buffer.
### Changelogs of `optimized staging lookup impl`
1. Converts staging buffer from previous structure to `Vec<Block>` for contiguous memory access
2. Adds `batch_boundaries` vector to track batch start positions
3. Introduces `block_position_index` for O(1) block ID to vector index mapping
### Performance Impact
- Improves search performance in staging buffers from O(number of staging blocks) to O(1 + number of selected staging blocks) by eliminating linear scans during get operations
- Easily extendable with new memory buffer implementations for benchmarking, testing, etc., and switch to the most efficient approach.
---------
Co-authored-by: thuong <ledacthuong2210>
Co-authored-by: Junfan Zhang <[email protected]>1 parent ff67a5c commit 27576c9
File tree
11 files changed
+864
-269
lines changed- riffle-server/src
- store
- mem
- buffer
- spill
11 files changed
+864
-269
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| 565 | + | |
565 | 566 | | |
566 | 567 | | |
567 | 568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| |||
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
| |||
55 | 64 | | |
56 | 65 | | |
57 | 66 | | |
| 67 | + | |
58 | 68 | | |
59 | 69 | | |
60 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
92 | | - | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
175 | 182 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
426 | 430 | | |
427 | 431 | | |
428 | 432 | | |
429 | | - | |
| 433 | + | |
430 | 434 | | |
431 | 435 | | |
432 | 436 | | |
| |||
469 | 473 | | |
470 | 474 | | |
471 | 475 | | |
472 | | - | |
| 476 | + | |
473 | 477 | | |
474 | 478 | | |
475 | 479 | | |
| |||
0 commit comments