Why is strcmp so much faster than my function?

后端 未结 3 1858

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 13:17

    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.

提交回复
热议问题