Why is string comparison so fast in python?
TL:DR: a slice compare is some Python overhead + a highly-optimized memcmp (unless there’s UTF-8 processing?). Ideally, use slice compares to find the first mismatch to within less than 128 bytes or something, then loop a char at a time. Or if it’s an option and the problem is important, make a modified copy of … Read more