Back VortexSession with ArcSwap for mutable but less errorprone session management#8631
Conversation
Signed-off-by: Robert Kruszewski <github@robertk.io>
Merging this PR will not alter performance
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | chunked_bool_canonical_into[(1000, 10)] |
15.9 µs | 26.6 µs | -40.26% |
| ❌ | Simulation | chunked_varbinview_into_canonical[(1000, 10)] |
168.9 µs | 205.5 µs | -17.77% |
| ❌ | Simulation | search_index_below_min_chunked |
1.3 ms | 1.6 ms | -16.68% |
| ❌ | Simulation | search_index_mixed_out_of_range_chunked |
1.3 ms | 1.6 ms | -16.59% |
| ❌ | Simulation | search_index_full_range_random_chunked |
1.4 ms | 1.6 ms | -16.26% |
| ❌ | Simulation | search_index_above_max_chunked |
1.7 ms | 2 ms | -14.63% |
| ❌ | Simulation | search_index_in_range_chunked |
1.9 ms | 2.2 ms | -13.61% |
| ⚡ | Simulation | encode_varbin[(1000, 8)] |
159.9 µs | 140.1 µs | +14.1% |
| ⚡ | Simulation | encode_varbin[(1000, 2)] |
157.4 µs | 138.7 µs | +13.47% |
| ⚡ | Simulation | chunked_varbinview_into_canonical[(100, 100)] |
306.6 µs | 271.6 µs | +12.89% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[128] |
273.6 ns | 244.4 ns | +11.93% |
| ⚡ | Simulation | compact_sliced[(4096, 90)] |
895.8 ns | 808.3 ns | +10.82% |
| ⚡ | Simulation | chunked_varbinview_opt_into_canonical[(100, 100)] |
388.9 µs | 353.2 µs | +10.11% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/cool-mendel-iclftk (83cc11b) with develop (3e7098c)
Footnotes
-
4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
Ok.... so instead of deadlocks we now have a footgun for getting stale data? Why have a mutable session if you make it easy to snapshot state out of the session that will never reflect mutability? |
…lding a guard Adds coverage for the case where a `SessionGuard` is held while the session is written through. A guard is a lock-free arc-swap snapshot, not a lock, so writes never wait on outstanding guards: - `inserting_a_default_while_holding_a_guard_succeeds`: holds a guard for one variable, then reads a *missing* variable (which inserts its default copy-on-write via `rcu`) while the first guard is still alive. The insert completes instead of deadlocking, and both the held and freshly read guards are usable. - `a_held_guard_keeps_observing_its_own_snapshot_after_a_write`: a held guard keeps observing the snapshot it was read from (arc-swap keeps that snapshot alive for the guard's lifetime) while a fresh read sees the newly published value. Signed-off-by: Robert Kruszewski <robert@spiraldb.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ncJ2VLHwbpsM1hMMBpXGP
|
I don't understand what you're referring to? Can you maybe write a test to demonstrate? |
I think immutable session is nice but hard to integrate it with for a lot of
systems