Thursday, April 7, 2011

Performance of comparing arrays

For the test I have used 2.3 mb file, being read to a byte array before all tests, and each test is run 100 times.


Release, ms


Debug, ms


MemCmp and UnsafeBytesCompare8Step are the fastest
UnsafeBytesCompareMs is used in .NET to compare Strings.

Performance of MemCmpFromPtr is as much as the MemCmp performance if initializing of IntPtr
is implemented outside the function.

MemCmp uses memcmp



Source code:










0 коммент.:

Post a Comment

Powered by Blogger.