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

Port the benchmark harness to async mode and add an initial AsyncSequence benchmark #36923

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Catfish-Man
Copy link
Contributor

No description provided.

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

main()
if #available(macOS 9999, *) {

Task.runDetached {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task.runDetached is now detach

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately detach was incorrectly marked not static in the compiler I'm using

exit(0)
}

sleep(100000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have control over how this gets compiled and can pass parse-as-library to the invocation, wrapping the detached run in

@main struct Main {
    static func main() async {
      // The code
     }
}

will give you an async context that you can await on instead of sleeping for a kajillion moments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a temporary workaround you can use runAsyncAndBlock

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

swift-ci commented May 5, 2021

Build failed
Swift Test OS X Platform
Git Sha - 4e83022

(cherry picked from commit 477b4a8008c7418afaf17fe334b361f4e6b97304)
(cherry picked from commit fad8fd0007449c2f37a69650b415ff12c9734855)
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

swift-ci commented May 5, 2021

Build failed
Swift Test OS X Platform
Git Sha - a32f25f

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

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.

None yet

4 participants