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
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.
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.