Use a sentinel for list iterators - #115
Conversation
Represent list links as a circular chain around an embedded, valueless sentinel. End iterators now point to a stable node, so an iterator obtained before insertion sees the current tail and transferred element iterators follow the destination after splice or move. This removes the per-iterator tail snapshot and cuts iterators from two pointers to one. It also replaces null endpoint cases with ordinary link updates without growing the container. Boost.Asio exposed the old-end issue when it spliced a recycled reactor queue node into an empty list and decremented the previously obtained end iterator.
Compile-time performance diffCompiler: Repetitions: 5 per configuration. psychicstd compile time, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. 🔴 1 slower · 🟡 2 within noise.
🟡 2 benchmark(s) within noise
Reproduce this on your machine: |
eigen build-time diff (compile / run tests)Compiler: Repetitions: 2 per configuration. eigen build time with psychicstd, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. No significant changes (🟡 2 within noise). 🟡 2 benchmark(s) within noise
Reproduce this on your machine: |
rdfind build-time diff (configure / compile / run tests)Compiler: Repetitions: 5 per configuration. rdfind build time with psychicstd, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. No significant changes (🟡 3 within noise). 🟡 3 benchmark(s) within noise
Reproduce this on your machine: |
flatbuffers build-time diff (configure / compile / run tests)Compiler: Repetitions: 1 per configuration. flatbuffers build time with psychicstd, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. No significant changes (🟡 3 within noise). 🟡 3 benchmark(s) within noise
Reproduce this on your machine: |
fmt build-time diff (compile / run tests)Compiler: Repetitions: 2 per configuration. fmt build time with psychicstd, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. No significant changes (🟡 2 within noise). 🟡 2 benchmark(s) within noise
Reproduce this on your machine: |
simdutf build-time diff (compile / run tests)Compiler: Repetitions: 1 per configuration. simdutf build time with psychicstd, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. No significant changes (🟡 2 within noise). 🟡 2 benchmark(s) within noise
Reproduce this on your machine: |
catch2 build-time diff (compile / run tests)Compiler: Repetitions: 3 per configuration. catch2 build time with psychicstd, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. No significant changes (🟡 2 within noise). 🟡 2 benchmark(s) within noise
Reproduce this on your machine: |
Compliance diffNo changes detected. 72 header(s) unchanged
Reproduce this on your machine: |
Sanitizer diff (ASan/UBSan)No changes detected. 72 header(s) unchanged
Reproduce this on your machine: |
cppcheck build-time diff (compile)Compiler: Repetitions: 2 per configuration. cppcheck build time with psychicstd, main vs this PR (same runner). 🟢 faster · 🔴 slower · 🟡 within noise. A change is colored only when its bootstrap 95% CI excludes 0 and it clears ±5% / 3ms. No significant changes (🟡 1 within noise). 🟡 1 benchmark(s) within noise
Reproduce this on your machine: |
Summary
Boost.Asio exposed the old representation when it retained an empty list end iterator, spliced in a recycled reactor node, and decremented the old iterator.
Validation