True Unsafe Code Performance

前端 未结 7 610

I understand unsafe code is more appropriate to access things like the Windows API and do unsafe type castings than to write more performant code, but I would like to ask yo

7条回答
  •  时光说笑
    2020-11-30 11:25

    In this response to an unrelated Stack Overflow article that has been viewed 881,000 times, benchmarks for various byte[] to hex string algorithms are shown.

    The fastest is an unsafe implementation of the same safe code that holds the #2 spot. The unsafe is over twice as fast in this comparison.

    The details of this algorithm are here.

提交回复
热议问题