Overview
In _wti_page_inmem_updates, the row-leaf branch previously called _wt_row_search on every row to determine where to apply the update. Since WT_ROW_FOREACH already provides the exact row pointer, the binary search was redundant and wasteful.
Changes
Position the cursor directly instead of searching:
- Set cbt.compare = 0 and cbt.ref = ref once before the loop.
- Set cbt.slot = WT_ROW_SLOT(page, rip) per iteration.
- Call __wt_row_modify directly with a NULL key.
When compare=0 and ins=NULL, __wt_row_modify writes directly to mod_row_update[slot] and never reaches the insert path where the key parameter is required. This also eliminates the key scratch buffer allocation (WT_DECL_ITEM(key)) entirely.
Impact
- Removes one binary search and one scratch buffer allocation per prepared or stop-timestamped row on every row-leaf page instantiation.
- The hot path for __wti_page_inmem_updates on large row-leaf pages is measurably cheaper.
Related Files
- src/btree/bt_page.c — __wti_page_inmem_updates
- src/btree/row_modify.c — __wt_row_modify (no changes, logic verified)
- related to
-
WT-17666 Skip scratch buffer in __rec_append_orig_value for non-overflow value cells
-
- Open
-