bheisler / criterion.rs

Statistics-driven benchmarking library for Rust
Apache License 2.0
4.31k stars 292 forks source link

`impl AsyncExecutor for tokio::runtime::Handle` #712

Open kpreid opened 11 months ago

kpreid commented 11 months ago

This will allow Tokio-based async benching without necessarily having access to the Runtime itself (e.g. inside of a #[tokio::main] function); a Handle is always obtainable via Handle::current().

lemmih commented 11 months ago

Anyone up for reviewing this PR?

waywardmonkeys commented 9 months ago

@kpreid Could you rebase this forward to fix the merge conflict?

@lemmih Since a tokio::runtime::Handle is just another way to get access to the currently running Runtime, I think this PR looks correct to me (without expert knowledge of tokio).

kpreid commented 9 months ago

I've rebased, but I noticed something weird while working with git on it: the affected files seem to have CRLF line endings (even though the .editorconfig file suggests the repo should be all LF). This is probably just either harmless or something to fix in another PR, but I thought I'd mention it in case I'm missing something.

waywardmonkeys commented 1 day ago

@kpreid Sorry to ask again, but could you rebase this (hopefully last time)?

kpreid commented 1 day ago

Done. I notice that async_executor.rs now has LF endings, but benchmarking_async.md still has CRLF. The PR should be consistent with existing text in each file.