How is Array.Copy implemented in C#? -
i tried @ implementation of array.copy in c# ilspy didn't show me implementation itself.
i wrote simple benchmark, array.copy vs simple loop copy data. array.copy faster.
how implemented faster?
thanks, shay
same techniques used write fast memcpy function:
- loop unrolling
- transfer of aligned data in large chunks (often using simd)
- cpu caching hints (simd helps here well)
see also:
Comments
Post a Comment