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

Convert Waitable from struct to pure template to avoid heap closures. #27

Merged
merged 3 commits into from
Sep 27, 2017

Conversation

s-ludwig
Copy link
Member

A first profiling run showed that every call to asyncAwait produced three to four heap closures, due to the way the different callbacks were wrapped. This change eliminates all of these to make room for more performance tuning.

@s-ludwig
Copy link
Member Author

Going to drop 2.070.0 support to sidestep those linker errors.

@s-ludwig
Copy link
Member Author

Hitting DigitalMars/optlink#18 here. Since issues like these often happen in a seemingly random fashion, I'm inclined to add the Optlink test runs to allowed_failures. (@WalterBright, FYI, if you have the time to look at it, this would provide a relatively self-contained reproduction case)

@s-ludwig
Copy link
Member Author

s-ludwig commented Sep 2, 2017

This also leads to 20% performance improvement for the bench-dummy-http-server example alone.

Also fixes a case where ThreadLocalWaiter.emitSingle overlaps a call to .emit.
@dlang-bot dlang-bot merged commit f6cd1d0 into master Sep 27, 2017
@s-ludwig s-ludwig deleted the nogc_async branch September 27, 2017 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants