Commit 302e58d
committed
address PR review: refactor and optimize adaptive batch size
- Rename compute_filtered_batch_size to predict_further_processing
and move to svs_runtime_utils.h for reuse
- Use float arithmetic instead of double for hit rate calculation
- Compute batch size at loop start to avoid unnecessary computation
- Use iterator.size() instead of per-element increment for total_checked
- Initial batch size = max(k, search_window_size)
- Apply adaptive batch size to vamana_index_impl.h filtered search1 parent 30d26c4 commit 302e58d
3 files changed
Lines changed: 24 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 41 | | |
56 | 42 | | |
57 | 43 | | |
| |||
140 | 126 | | |
141 | 127 | | |
142 | 128 | | |
143 | | - | |
| 129 | + | |
144 | 130 | | |
| 131 | + | |
| 132 | + | |
145 | 133 | | |
| 134 | + | |
146 | 135 | | |
147 | | - | |
148 | 136 | | |
149 | 137 | | |
150 | 138 | | |
| |||
153 | 141 | | |
154 | 142 | | |
155 | 143 | | |
156 | | - | |
157 | | - | |
158 | 144 | | |
159 | 145 | | |
160 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
434 | 448 | | |
435 | 449 | | |
436 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| |||
0 commit comments