Why is strcmp so much faster than my function?

后端 未结 3 1726
误落风尘
误落风尘 2021-02-12 12:16

I wrote a function, Str::Compare, that is basically a strcmp rewritten in another way. While comparing the two function, in a loop repeted 500\'000\'00

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-12 12:53

    I believe most of the standard libraries are written in assembly language. That could be the reason you see the standard library is faster than yours.

提交回复
热议问题