Summary
When snapshot support is enabled and background stream-head updates are on, each successful commit calls UpdateStreamHeadInBackgroundThread(...) via Task.Run. This schedules a new thread-pool work item per commit, adding task-scheduling overhead and GC pressure at high write rates.
Why this matters
- Task-scheduling overhead accumulates at high write rates.
- Fire-and-forget work can add GC pressure and increase tail latency.
- Benchmarks show a 2.5× write-time increase with background updates enabled vs disabled.
Baseline (net10, 2026-05-20)
| Benchmark |
Mean |
WriteToStream(CommitsToWrite=1000, DisableSnapshotSupport=False, PersistStreamHeadsOnBackgroundThread=True) |
2,631.6 ms |
WriteToStream(CommitsToWrite=1000, DisableSnapshotSupport=False, PersistStreamHeadsOnBackgroundThread=False) |
1,059.4 ms |
Delta: +148% overhead with background updates enabled.
Proposed investigation
Reference
See docs/Performance-Investigation.md → Finding #6 for full context.
Summary
When snapshot support is enabled and background stream-head updates are on, each successful commit calls
UpdateStreamHeadInBackgroundThread(...)viaTask.Run. This schedules a new thread-pool work item per commit, adding task-scheduling overhead and GC pressure at high write rates.Why this matters
Baseline (net10, 2026-05-20)
WriteToStream(CommitsToWrite=1000, DisableSnapshotSupport=False, PersistStreamHeadsOnBackgroundThread=True)WriteToStream(CommitsToWrite=1000, DisableSnapshotSupport=False, PersistStreamHeadsOnBackgroundThread=False)Delta: +148% overhead with background updates enabled.
Proposed investigation
Task.Runper commit.Reference
See
docs/Performance-Investigation.md→ Finding #6 for full context.