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

Improve flatScheduleTask #3079

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Conversation

clintonpi
Copy link
Contributor

@clintonpi clintonpi commented Jan 22, 2025

Motivation:

As pointed out in #3071, the flatScheduleTask implementations can be improved.

Modifications:

  • Refactor the flatScheduleTask implementations to skip flatMap calls, which avoids creating an extra promise.
  • As there is now a lower number of allocations, reduce the necessary thresholds for the allocation tests.

Result:

Reduction in the number of allocations in the package.

Motivation:

As pointed out in apple#3071, the `flatScheduleTask` implementations can be improved.

Modifications:

- Refactor the `flatScheduleTask` implementations to skip `flatMap` calls, which avoids creating an extra promise.

Result:

Potential reduction in the number of allocations in the package.
Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @clintonpi!

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jan 22, 2025
@glbrntt glbrntt linked an issue Jan 22, 2025 that may be closed by this pull request
@glbrntt glbrntt enabled auto-merge (squash) January 22, 2025 16:02
@glbrntt glbrntt merged commit b14012b into apple:main Jan 22, 2025
33 of 35 checks passed
@clintonpi clintonpi deleted the flat-schedule-task-improvement branch January 22, 2025 16:43
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.

Improve flatScheduleTask
2 participants