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

[Do not merge] Benchmark Tokio executor vs Rayon #31

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

michaelsproul
Copy link
Member

This is an experimental PR to try using Tokio in place of Rayon. Tokio also uses a work-stealing thread pool for execution, but has better support for mutexes and locks (see rayon-rs/rayon#592).

It turns out that these better locks come with significantly higher overhead, and tree hashing runs 3-4x slower on Tokio than it does on Rayon: 140ms (tokio) vs 40ms (rayon).

This branch needs to be compiled with tokio_unstable enabled:

RUSTFLAGS="--cfg tokio_unstable" cargo bench -- async_tree_hash_root_list

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.

1 participant