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

Add optional async setup for iter_batch #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samtay
Copy link

@samtay samtay commented Feb 16, 2023

This improves usability in async contexts. For example you might have

struct Struct;

impl Struct {
    pub fn new() -> Self { Self }
    pub async fn init_phase(&mut self) {}
    pub async fn something_worth_benchmarking(&self) {}
}

but currently you can't use init_phase in the iter_batch setup.

I decided to just offer a new variant so that this wouldn't be a breaking change. I've also got a different version (ref 7d12e73) that updates all the async benchers to allow async setups. If that's preferable, let me know and I'll push that instead.

Closes #576.

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.

AsyncBencher::iter_batched() setup closure to return a Future
1 participant