比较10,000字节字符串的最快方法

use*_*619 -1 python

我试图比较2 10,000字节的字符串,这需要很多时间..有没有最快的比较方式?

请关闭它,问题不在于比较..我只是注意到它..

mgi*_*son 5

在python中比较两个字符串的最快方法始终是:

if s1 == s2:
   print "strings are equal"
Run Code Online (Sandbox Code Playgroud)

如果您有其他约束,则需要明确说明它们.