This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
Buffer.BlockCopy optimization for arrays of same type - #1283
Merged
Merged
Conversation
Member
There was a problem hiding this comment.
EETypePtr has custom operator!= that has non-trivial cost... .
Contributor
Author
There was a problem hiding this comment.
@jkotas What about doing a raw pointer comparison, e.g. src.EETypePtr.ToPointer() == dst.EETypePtr.ToPointer()?
The latter overloads the operator ==, and it can be expensive.
Contributor
Author
Member
|
LGTM. Thanks! |
Member
|
This fix is not right - it fails internal tests. |
Contributor
Author
|
@jkotas How is that possible? Can two arrays have different |
Member
|
It breaks computation of |
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.
Basically a port of dotnet/coreclr#4807 to corert.
Not sure if there's a way to apply the byte array-related optimizations from there as well here (so we can skip the first primitive typecheck as well, if either
srcordstis a byte array) (how would you 'load' the byte array EETypePtr statically so you could compare it likesrc.EETypePtr == s_byteArrayTypePtr?).cc @jkotas