Commit c4855e4
Add spin-wait in GetNext before epoch-table scan
When the iterator catches up to the cached SafeTailAddress, spin briefly
(SpinWait(100) ≈ a few μs) before scanning the epoch table. This lets
concurrent producers complete in-flight writes and advance TailAddress,
so the subsequent RefreshSafeTailAddress scan jumps the cache forward by
many records. The next batch of GetNext calls then use the O(1) cached
path, amortizing the scan cost to ~1ns/record.
Benchmark: 1T WithConsumer improves from ~2.6 Mops (immediate scan) to
~8.0 Mops (spin-wait), matching the dev@10ms baseline (7.7 Mops).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8e27fd3 commit c4855e4
2 files changed
Lines changed: 22 additions & 14 deletions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1175 | 1175 | | |
1176 | 1176 | | |
1177 | 1177 | | |
1178 | | - | |
| 1178 | + | |
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| |||
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
759 | 765 | | |
760 | 766 | | |
761 | 767 | | |
| |||
873 | 879 | | |
874 | 880 | | |
875 | 881 | | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
882 | 890 | | |
883 | 891 | | |
884 | 892 | | |
| |||
0 commit comments