Closed ycrumeyrolle closed 3 years ago
The main benefit of the Unsafe.CopyBlock come from the jitter that is able to identify a constant sized byte array and to vectorize the copy.
Method | Mean | Error | StdDev | Ratio | RatioSD | Code Size |
---|---|---|---|---|---|---|
InitUint32_Original | 2.6049 ns | 0.0357 ns | 0.0316 ns | 1.00 | 0.00 | 128 B |
InitUint32_UnsafeCopyBlock | 0.7034 ns | 0.0538 ns | 0.0681 ns | 0.27 | 0.03 | 104 B |
InitUint32_UnsafeCopyBlockUnaligned | 1.0163 ns | 0.0522 ns | 0.0536 ns | 0.39 | 0.02 | 104 B |
InitUint32_SpanCopyTo | 3.4210 ns | 0.0961 ns | 0.1107 ns | 1.32 | 0.04 | 426 B |
InitUint64_Original | 4.0400 ns | 0.1044 ns | 0.1025 ns | 1.55 | 0.04 | 185 B |
InitUint64_UnsafeCopyBlockUnaligned | 2.9553 ns | 0.0524 ns | 0.0409 ns | 1.13 | 0.01 | 125 B |
InitUint64_UnsafeCopyBlock | 2.9520 ns | 0.0556 ns | 0.0492 ns | 1.13 | 0.02 | 125 B |
InitUint64_SpanCopyTo | 5.3443 ns | 0.1144 ns | 0.1405 ns | 2.06 | 0.06 | 436 B |
Codecov Report
96.00% <100.00%> (ø)
75.24% <100.00%> (ø)
93.14% <100.00%> (ø)
Continue to review full report at Codecov.