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

Avoid abstraction overheads on isolated ELF #3055

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Jan 13, 2025

Motivation:

Unfortunately, closure composition is really expensive: closures that capture closures always heap allocate. To make ELF.Isolated perform well, then, we need to inline the method bodies directly.

Modifications:

  • Add some isolated functions into ELF for enqueueing callbacks.
  • Inline the implementation of the ELF methods into the isolated view.

Result:

Allocation counts match between isolated/nonisolated.

Motivation:

Unfortunately, closure composition is really expensive: closures that
capture closures always heap allocate. To make ELF.Isolated perform well,
then, we need to inline the method bodies directly.

Modifications:

- Add some isolated functions into ELF for enqueueing callbacks.
- Inline the implementation of the ELF methods into the isolated view.

Result:

Allocation counts match between isolated/nonisolated.
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Jan 13, 2025
@Lukasa Lukasa merged commit e19202c into apple:main Jan 13, 2025
34 of 35 checks passed
@Lukasa Lukasa deleted the cb-improve-isolated-view-performance branch January 13, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants