Update portable thread pool event enablement checks #45681
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IsEnabled()
on the caller side of the event method since it was seen that in very hot paths where events may be fired, more complicated checks involving keyword and verbosity increased the code size in the caller unnecessarily, making it slower.IsEnabled()
(without keyword and verbosity checks) is a simple check that can be inlined and is less intrusive to the hot path callers. Instead, the callee (the public method in the event source) would check enablement based on keyword and verbosity, and in the really hot paths where it was necessary the callee was also attributed withNoInlining
.IsEnabled
checks in Migrate coreclr's worker thread pool to be able to use the portable thread pool in opt-in fashion #38225 (comment), I understood that the common paths in the eventing infra would do the necessary checks including keyword and verbosity checks before firing an event. That does not seem to be the case, hence Make PortableThreadPool to check events correctly before firing them #45666.IsEnabled
checks, which was in response to the comment above, and reverted Make PortableThreadPool to check events correctly before firing them #45666 to restore the original intention