NightOwl888 opened a new pull request, #766:
URL: https://github.com/apache/lucenenet/pull/766

   - Added `Arrays.Copy()` overloads to choose the best copy option for the 
platform, operating system, and data type (at least a 20% improvement)
   - Use `Arrays.Copy()` to do the heavy lifting for the `Arrays.CopyOf()` and 
`Arrays.CopyOfRange()` methods (a ~10x improvement)
   - Use `Span().Fill()` or `Array.Fill()` to do the heavy lifting for the 
`Arrays.Fill()` overloads.
   - Reviewed to ensure we are calling `Arrays.Fill()` instead of using a 
slower approach such as `Array.Clear()` or a for loop.
   
   We were using `Buffer.BlockCopy()` for copying bytes in a lot of performance 
sensitive areas (such as codecs). Although, this is a slight edge over 
`Array.Copy()` on .NET Framework, on .NET Core, this is the slowest option. 
This replaces all of those calls with `Arrays.Copy()`, which is faster in all 
cases that were 
[benchmarked](https://github.com/NightOwl888/BenchmarkPlayground/actions/runs/3505025335).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to