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

Better thread management #309

Open
hai-rise opened this issue Sep 4, 2024 · 3 comments
Open

Better thread management #309

hai-rise opened this issue Sep 4, 2024 · 3 comments

Comments

@hai-rise
Copy link
Contributor

hai-rise commented Sep 4, 2024

  • A thread pool (of parked threads) may work better. Early experiments with rayon were very poor, so we may need to roll a specialized implementation.
  • We should start post-processing as soon as the scheduler flags completion, instead of waiting for the scoped threads to join (very sad tail-end latency).
  • We should re-consider exiting idle threads early like having no new work after 100 iterations.
@byhashdong
Copy link
Contributor

@hai-rise Why rayon has a poor performance, what's the bottleneck?

@hai-rise
Copy link
Contributor Author

hai-rise commented Oct 9, 2024

@byhashdong I didn't have time to inspect; just replaced thread::scope with rayon::scope and saw the benchmarks got much slower. I'd love to add a rayon thread pool to the new Pevm struct (didn't exist back then) and retry it. Kinda similar to how Aptos's doing it:
https://github.com/aptos-labs/aptos-core/blob/f8eef74f9f712fcc0e809265ec2b77013a683184/aptos-move/block-executor/src/executor.rs#L72

I can create a dedicated issue for the experiment if you're interested in it 🙏.

@byhashdong
Copy link
Contributor

Sure, I would like to study it. Please assign it to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants