Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box NewTaskPayload to reduce size greatly #2881

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

ryoqun
Copy link
Member

@ryoqun ryoqun commented Sep 10, 2024

Problem

NewTaskPayload is large (more than 200 bytes) due to its direct inclusion of ExecuteTimings. In turn, this causes large mem writes/reads around crossbeam channel even for NewTaskPayload::Task.

Note that this is particularly problematic for block production mode (senders are multi-threaded whereas block verification is currently single-threaded) because those writes are inside crossbeam channel's linearization point, creating a source of contention.

Summary of Changes

Box the rare variant, which only occurs once per bank, benefiting the other variant channel transmission (99.9% of time). Overall, extra indirection for access and mem alloc/dealloc for the NewTaskPayload::OpenSubchannel variant pays off.

before

ledger processed in 13 seconds, 977 ms
ledger processed in 13 seconds, 777 ms
ledger processed in 13 seconds, 905 ms

after

maybe 1-2% gain.

ledger processed in 13 seconds, 678 ms
ledger processed in 13 seconds, 512 ms
ledger processed in 13 seconds, 856 ms

Extracted from: #2325

@ryoqun ryoqun force-pushed the boxed-new-task-payload branch from 40875a7 to 20a13ab Compare September 10, 2024 04:02
@ryoqun ryoqun requested a review from apfitzge September 10, 2024 04:21
@ryoqun ryoqun merged commit 6bd5d38 into anza-xyz:master Sep 10, 2024
51 checks passed
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
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.

2 participants