Skip to content

Async/Await support in Performance Testing methods #487

@ali-ahsan-ali

Description

@ali-ahsan-ali

If you have an async function it is currently not possible to test it utilising the XCTest Measure library. Even if you have no awaits as part of the async function, if the function signature is async and needs to be awaited it does not work.

Suggestion: Run the method as part of main actor, starting the measuring of what I will call block() right before execution and ending right after execution.

Assuming no other tasks are spun up inside the function being called, would this ensure that the task is run synchronously and thus performance tested? Or is there other alternatives.

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