Commit ba4800d
Optimize insert probing with early EMPTY check
In find_or_find_insert_index_inner, when the first empty-or-deleted
slot found is EMPTY (not a tombstone), return immediately without
the expensive match_empty() SIMD group scan. This is the common case
when there are no tombstones in the table.
An EMPTY byte at the computed index also guarantees the index is
valid (not a small-table wrapping false positive), so the
fix_insert_index check is skipped too.
Benchmarks (aarch64, 10 runs, median):
insert_foldhash_serial: 11,734 -> 11,410 ns (-2.8%)
rehash_in_place: 220,745 -> 189,163 ns (-14.3%)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7e10037 commit ba4800d
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1832 | 1832 | | |
1833 | 1833 | | |
1834 | 1834 | | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
1835 | 1853 | | |
1836 | 1854 | | |
1837 | 1855 | | |
| |||
0 commit comments