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

Suppress the performance checker warning by being sneaky #2620

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Jan 5, 2024

Motivation:

Users are receiving thread performance checker warnings when they create MTELGs. This is largely unnecessary: MTELGs are not typically created on the fly but instead once, at program startup. That means the issue here isn't really all that profound.

While we could work around it by substantially rearchitecting the event loops (see #2618), an easier fix is to observe that the thread performance checker doesn't fire when we use condition variables.

Modifications:

Remove the use of the DispatchGroup and replace it with a condition variable.

Result:

Simpler code and no thread performance checker warning.
Replaces #2618.
Resolves #2223.

Motivation:

Users are receiving thread performance checker warnings when
they create MTELGs. This is largely unnecessary: MTELGs are
not typically created on the fly but instead once, at program
startup. That means the issue here isn't really all that
profound.

While we could work around it by substantially rearchitecting
the event loops (see apple#2618), an easier fix is to observe that
the thread performance checker doesn't fire when we use
condition variables.

Modifications:

Remove the use of the DispatchGroup and replace it with a
condition variable.

Result:

Simpler code and no thread performance checker warning.
@Lukasa Lukasa added the semver/patch No public API change. label Jan 5, 2024
@Lukasa Lukasa merged commit f32c9a3 into apple:main Jan 5, 2024
9 of 10 checks passed
@Lukasa Lukasa deleted the cb-condvars-are-sneaky branch January 5, 2024 11:15
rebello95 added a commit to connectrpc/connect-swift that referenced this pull request Jan 31, 2024
Updates our NIO dependencies to include
https://github.com/apple/swift-nio/releases/tag/2.63.0 which fixes a
performance checker warning seen when instantiating the NIO client from
the main thread: apple/swift-nio#2620.

Resolves #181.
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.

Xcode 14 Thread Performance Checker Warning
2 participants