Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Update MemSet/MemCopy helpers on Windows to a faster implementation. #7341

Closed
wants to merge 1 commit into from

Conversation

swaroop-sridhar
Copy link

This PR provides an optimized version of JIT_MemSet/JIT_MemCpy assembly helper
functions on 64-bit Windows. JIT_MemSet gets invoked when bytecode Initblk is
executed while JIT_MemCpy gets invoked when bytecode Cpblk is executed.
JIT_MemCpy takes care of both overlap and non-overlap scenarios.
The use of this optimized JIT_MemCpy is extended to Buffer::BlockCopy
and Buffer::InternalBlockCopy by replacing the CRT memmove.

The unit test BlockCopyPerf.cs is used as reference and modified so that the
copy length varies from 0 byte to 520 bytes.
This micro benchmark tests Buffer::BlockCopy (JIT_MemCpy).
The following chart and table show the result on
Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz with 32GB RAM. OS is
Windows 10 Enterprise.

Further details about performance improvements are available at
#7198

Fixes #7146.

This PR provides an optimized version of JIT_MemSet/JIT_MemCpy assembly helper
functions on 64-bit Windows. JIT_MemSet gets invoked when bytecode Initblk is
executed while JIT_MemCpy gets invoked when bytecode Cpblk is executed.
JIT_MemCpy takes care of both overlap and non-overlap scenarios.
The use of this optimized JIT_MemCpy is extended to Buffer::BlockCopy
and Buffer::InternalBlockCopy by replacing the CRT memmove.

The unit test BlockCopyPerf.cs is used as reference and modified so that the
copy length varies from 0 byte to 520 bytes.
This micro benchmark tests Buffer::BlockCopy (JIT_MemCpy).
The following chart and table show the result on
Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz with 32GB RAM. OS is
Windows 10 Enterprise.

Further details about performance improvements are available at
dotnet#7198

Fixes #7146.
@swaroop-sridhar
Copy link
Author

This feature is #7146 moved to 1.2.
So, closing the PR, since the change is already in master branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants