Skip to content

[6.0] Don't use Synchronization.Atomic for deliverExpectationCheckedEvents. #667

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

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Sep 6, 2024

Explanation: Drops use of Atomic<Int> which is giving us some grief in some build environments where the Synchronization module isn't available.
Scope: 6.0 branch
Issue: N/A
Original PR: #666
Risk: Low
Testing: Existing coverage.
Reviewer: @briancroom @suzannaratcliff @stmontgomery

@grynspan grynspan added bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support performance 🏎️ Performance issues swift-6.0.x labels Sep 6, 2024
@grynspan grynspan self-assigned this Sep 6, 2024
@grynspan
Copy link
Contributor Author

grynspan commented Sep 6, 2024

@swift-ci please test

@grynspan
Copy link
Contributor Author

grynspan commented Sep 6, 2024

@swift-ci test macOS

…ts`.

This PR replaces the new use of `Atomic<Int>` with a `Locked<Int>` in the
implementation of `deliverExpectationCheckedEvents`. Why? Because we're running
into some environments where the Synchronization module isn't available (e.g.
older host macOSes) and this is simpler. The performance profile is comparable:
on my system, running the `repeatedlyExpect()` test takes 0.55s instead of 0.49s
to call `#expect()` 1,000,000 times, so it's still a significant win over the
implementation we had earlier.
@grynspan grynspan force-pushed the jgrynspan/no-atomic-for-delivered-check-6.0 branch from 46a1244 to b24e836 Compare September 6, 2024 15:50
@grynspan
Copy link
Contributor Author

grynspan commented Sep 6, 2024

@swift-ci test

@grynspan grynspan merged commit 6c447c3 into release/6.0 Sep 6, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/no-atomic-for-delivered-check-6.0 branch September 6, 2024 17:36
@grynspan grynspan added this to the Swift 6.0.1 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support performance 🏎️ Performance issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants