-
Notifications
You must be signed in to change notification settings - Fork 340
couldn't find bench macro in async_std #749
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
Comments
Anyone knows how to avoid using b.iter(|| // how to execute async function here using async_std) seems like |
@GopherJ you can use https://docs.rs/futures/0.3.4/futures/executor/index.html and task::spawn https://docs.rs/async-std/1.5.0/async_std/task/index.html#spawning-a-task |
@humb1t I think it's not a good idea to create an async runtime in bench iterator, because in that case the creating time will be counted in. |
you can create |
@humb1t could you give an example? because for me I don't think it'll work because I still cannot use async code in b.iter |
See also async-rs/async-attributes#9 and #70 (comment) |
@GopherJ sorry - didn't check notifications for a while. https://github.com/hyperledger/iroha/blob/iroha2-dev/iroha_client/benches/torii.rs this is our current benches, but we block inside iter. |
@humb1t hi no pb. I think |
It seems I cannot have
async_std::bench
attribute even when I activateattributes
featureThe text was updated successfully, but these errors were encountered: