Skip to content

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