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

Add a fast path for byte[] to Buffer.BlockCopy #3118

Merged
merged 1 commit into from Feb 11, 2016

Conversation

Projects
None yet
6 participants
@jkotas
Member

jkotas commented Feb 10, 2016

No description provided.

@jkotas

This comment has been minimized.

Show comment
Hide comment
@jkotas
Member

jkotas commented Feb 10, 2016

Show outdated Hide outdated src/vm/comutilnative.cpp Outdated
@stephentoub

This comment has been minimized.

Show comment
Hide comment
@stephentoub
Member

stephentoub commented Feb 10, 2016

LGTM

1 similar comment
@geoffkizer

This comment has been minimized.

Show comment
Hide comment
@geoffkizer

geoffkizer Feb 10, 2016

Member

LGTM

Member

geoffkizer commented Feb 10, 2016

LGTM

jkotas added a commit that referenced this pull request Feb 11, 2016

Merge pull request #3118 from jkotas/buffercopy
Add a fast path for byte[] to Buffer.BlockCopy

@jkotas jkotas merged commit 85c57ca into dotnet:master Feb 11, 2016

7 of 8 checks passed

Ubuntu x64 Checked Build and Test Build finished. No test results found.
Details
CentOS7.1 x64 Checked Build Build finished. 804 tests run, 0 skipped, 0 failed.
Details
FreeBSD x64 Checked Build Build finished. 804 tests run, 0 skipped, 0 failed.
Details
OSX x64 Checked Build and Test Build finished. No test results found.
Details
Windows_NT x64 Debug Build and Test Build finished. 5607 tests run, 0 skipped, 0 failed.
Details
Windows_NT x64 Release Build and Test Build finished. 5607 tests run, 0 skipped, 0 failed.
Details
Windows_NT x86 Debug Build Build finished. No test results found.
Details
Windows_NT x86 Release Build Build finished. No test results found.
Details

stephentoub added a commit to stephentoub/corefx that referenced this pull request Feb 14, 2016

Use Buffer.BlockCopy with byte[]
In particular after dotnet/coreclr#3118, Buffer.BlockCopy has less overhead than Array.Copy when copying byte[]s, such that there's no benefit to using Array.Copy and potential benefit to using Buffer.BlockCopy.

This commit replaces usage of Array.Copy(byte[], ...) in corefx with Buffer.BlockCopy(byte[], ...).  A lot of places were already using it.

(In a few places where we weren't passing lower bounds to Array.Copy with T[] arguments, I added explicit lower bounds as well to avoid the overload needing to call GetLowerBound.)

stephentoub added a commit to stephentoub/corefx that referenced this pull request Feb 14, 2016

Use Buffer.BlockCopy with byte[]
In particular after dotnet/coreclr#3118, Buffer.BlockCopy has less overhead than Array.Copy when copying byte[]s, such that there's no benefit to using Array.Copy and potential benefit to using Buffer.BlockCopy.

This commit replaces usage of Array.Copy(byte[], ...) in corefx with Buffer.BlockCopy(byte[], ...).  A lot of places were already using it.

(In a few places where we weren't passing lower bounds to Array.Copy with T[] arguments, I added explicit lower bounds as well to avoid the overload needing to call GetLowerBound.)

stephentoub added a commit to stephentoub/corefx that referenced this pull request Feb 14, 2016

Use Buffer.BlockCopy with byte[]
In particular after dotnet/coreclr#3118, Buffer.BlockCopy has less overhead than Array.Copy when copying byte[]s, such that there's no benefit to using Array.Copy and potential benefit to using Buffer.BlockCopy.

This commit replaces usage of Array.Copy(byte[], ...) in corefx with Buffer.BlockCopy(byte[], ...).  A lot of places were already using it.

(In a few places where we weren't passing lower bounds to Array.Copy with T[] arguments, I added explicit lower bounds as well to avoid the overload needing to call GetLowerBound.)

@benaadams benaadams referenced this pull request Feb 15, 2016

Closed

Use Buffer.MemoryCopy #544

@jkotas jkotas deleted the jkotas:buffercopy branch Feb 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment