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

[Scheduler] Pack Mutex<TxStatus> into AtomicU8 #263

Open
hai-rise opened this issue Aug 21, 2024 · 0 comments · May be fixed by #266
Open

[Scheduler] Pack Mutex<TxStatus> into AtomicU8 #263

hai-rise opened this issue Aug 21, 2024 · 0 comments · May be fixed by #266
Labels
enhancement New feature or request experimental

Comments

@hai-rise
Copy link
Contributor

hai-rise commented Aug 21, 2024

pevm/src/scheduler.rs

Lines 42 to 44 in 131d274

// TODO: Consider packing [TxStatus]s into atomics instead of
// [Mutex] given how small they are.
transactions_status: Vec<Mutex<TxStatus>>,

Rough idea:

  • First bit: Being locked or not.
  • Next 3 bits: up-to 8 transaction statuses.
  • Next 60 bits: up-to 2^60 incarnation index.

This should save 16~18 bytes per transaction and hopefully improve performance.

@hai-rise hai-rise changed the title Pack Mutex<TxStatus> into AtomicU8 [Scheduler] Pack Mutex<TxStatus> into AtomicU8 Aug 21, 2024
@kien-rise kien-rise linked a pull request Aug 22, 2024 that will close this issue
@hai-rise hai-rise added enhancement New feature or request experimental labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experimental
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants