Skip to content

chore: Apply block thread priority - #2430

Open
sergerad wants to merge 6 commits into
sergerad-fix-pruningfrom
sergerad-apply-block-priority
Open

chore: Apply block thread priority#2430
sergerad wants to merge 6 commits into
sergerad-fix-pruningfrom
sergerad-apply-block-priority

Conversation

@sergerad

@sergerad sergerad commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #2375.

benchmark-mixed -n 50000 -p 50 --storage-map-entries 64 --account-update-blocks 20 -r 16

Metric lock-free apply-block-priority Δ (branch vs lock-free)
Reads/sec 83,770 45,723 −45%
Total reads 33.7M 11.6M −66%
P50 read latency 90µs 229µs 2.5× worse
P95 687µs 927µs 1.3× worse
P99 1.26ms 1.53ms 1.2× worse
P99.9 4.1ms 5.1ms 1.2× worse
Avg block insertion 426ms 382ms 10% faster
Total seeding time 405s 256s 37% faster
Avg get-batch-inputs 2.0ms 1.8ms ~equal

This branch is much faster on the write side (256s total seeding vs 304s on next, 382ms avg block insertion) but the read side degraded substantially — roughly half the read throughput of next (45.7k vs 73.8k reads/sec) and ~2.7× worse P50 (229µs vs 83µs). That's consistent with what the branch does: giving the apply-block thread elevated priority starves the concurrent readers under load. Tail latency also regressed vs both columns (P99.9 of 5.1ms vs 4.1ms lock-free / 9.8ms next — still ahead of next there).

Changelog

changelog = "none"
reason    = "Internal change only."

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rerun the benchmarks you did previously for this?

Comment thread crates/store/src/state/writer/worker.rs Outdated
Comment thread crates/store/src/state/writer/worker.rs

@kkovaacs kkovaacs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@sergerad
sergerad force-pushed the sergerad-apply-block-priority branch from f865285 to 7c4e6f0 Compare August 5, 2026 01:20
@sergerad
sergerad changed the base branch from sergerad-sync-writers-enum to sergerad-fix-pruning August 5, 2026 23:56
@sergerad
sergerad force-pushed the sergerad-apply-block-priority branch from b437db5 to df8f669 Compare August 5, 2026 23:57
@sergerad
sergerad force-pushed the sergerad-apply-block-priority branch from 2d151a9 to 1db4774 Compare August 6, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dedicated core allocation for apply_block

3 participants