Skip to content

Benchmark async functions #100

@Dreamsorcerer

Description

@Dreamsorcerer

The documentation says you can use the fixture like this:

    benchmark(sum, data) # Only the `sum` function is measured

But, there's no mention of how you might benchmark an async function. Can this be done, or added in an upcoming release?

I guess I'd expect to be able to do something along the lines of one of these:

await benchmark(async_func)
await benchmark(async_func())
await benchmark.async(async_func)

(I imagine if you went for the second version, it'd be a simple task of checking inspect.isawaitable() and then returning an async wrapped benchmark).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions