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

[SelectableEventLoop] SR-15872; Save allocations when appending task #2046

Merged
merged 7 commits into from
Feb 17, 2022

Conversation

fabianfett
Copy link
Member

@fabianfett fabianfett commented Feb 16, 2022

We should probably wait for #2047, before we merge this one.

Motivation

  • Workaround for SR-15872. We don't want to occur an allocate for every task that shall be allocated.

Changes

  • Use [ScheduledTask] instead of [() -> Void]

Result

  • Fewer allocations = faster code

Alternatives

We could create a struct that really only wraps the closure.

@fabianfett fabianfett changed the title Experiment. On macOS allocations dropped. [SelectableEventLoop] SR-15872; Save allocations when appending task Feb 16, 2022
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Feb 17, 2022
Copy link
Member

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

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

Nice improvements! LGTM.

@fabianfett fabianfett marked this pull request as ready for review February 17, 2022 09:42
@fabianfett fabianfett force-pushed the ff-tasks-are-crazy branch 2 times, most recently from d889ab8 to 19c51d7 Compare February 17, 2022 14:58
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Nice fix!

@Lukasa Lukasa enabled auto-merge (squash) February 17, 2022 16:42
@Lukasa Lukasa merged commit c74c3bb into apple:main Feb 17, 2022
@fabianfett fabianfett deleted the ff-tasks-are-crazy branch February 17, 2022 20:22
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.

4 participants