Optimize Half.Equals - #41554
Merged
Merged
Conversation
Collaborator
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
jkotas
reviewed
Aug 29, 2020
| /// <summary> | ||
| /// Returns a value that indicates whether this instance is equal to a specified <paramref name="other"/> value. | ||
| /// </summary> | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] |
Member
There was a problem hiding this comment.
AggressiveInlining does improve microbenchmark results, but it introduces code bloat that tends to hurt real workloads. We are careful about using it.
Given that nothing else is annotated with AggressiveInlining in Half, I would not introduce one-off here. I think we would need some real world examples to justify it, and likely apply it to number of other methods in this file.
Member
Author
There was a problem hiding this comment.
Sure. Removed for this PR. Let it be a part of optimizing the whole Half type.
miranda76
approved these changes
Aug 29, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #41329
Benchmark:
(See full benchmark at #41329 (comment))
Further question
Should we apply more
AggressiveInlineingonHalfmembers?If we've get hardware acceleration, the implementation should change massively, and can be considered later.
Should call size bloat be considered?