Skip to content

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

Open
0x8f701 opened this issue Apr 13, 2020 · 8 comments
Open

couldn't find bench macro in async_std #749

0x8f701 opened this issue Apr 13, 2020 · 8 comments
Labels
question/feedback A question or user feedback

Comments

@0x8f701
Copy link

0x8f701 commented Apr 13, 2020

It seems I cannot have async_std::bench attribute even when I activate attributes feature

@0x8f701
Copy link
Author

0x8f701 commented Apr 13, 2020

Anyone knows how to avoid using block_on in rust bench:

b.iter(|| // how to execute async function here using async_std)

seems like block_on is a little bit heavy and I would like to avoid using block_on in bench iter

@humb1t
Copy link

humb1t commented Apr 16, 2020

@0x8f701
Copy link
Author

0x8f701 commented Apr 16, 2020

@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.

@humb1t
Copy link

humb1t commented Apr 17, 2020

you can create ThreadPool before b.iter() and use one runtime for entire benchmark like you do to preconfigure another environment entities.

@0x8f701
Copy link
Author

0x8f701 commented Apr 17, 2020

@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

@dignifiedquire dignifiedquire added the question/feedback A question or user feedback label May 2, 2020
@taiki-e
Copy link
Contributor

taiki-e commented May 3, 2020

It seems I cannot have async_std::bench attribute even when I activate attributes feature

See also async-rs/async-attributes#9 and #70 (comment)

@0x8f701 0x8f701 changed the title couldn't find bench in async_std couldn't find [bench] in async_std May 3, 2020
@0x8f701 0x8f701 changed the title couldn't find [bench] in async_std couldn't find bench macro in async_std May 3, 2020
@humb1t
Copy link

humb1t commented Jun 4, 2020

@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.

@0x8f701
Copy link
Author

0x8f701 commented Jun 4, 2020

@humb1t hi no pb. I think block_on inside iter will give incorrect figures. especially for [email protected] and tokio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question/feedback A question or user feedback
Projects
None yet
Development

No branches or pull requests

4 participants