Skip to content

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.

@kyteware
Copy link

This would be really helpful!! I would prefer not to use iter_custom.

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

2 participants