|
|
|
|
|
by creata
1956 days ago
|
|
> Reordering the character equality condition could help a tiny bit since the inequality check should be faster than the ignore case check. I think the given ordering is better: in a conjuction, you typically put the less likely condition first, not the cheaper one. |
|
Out of curiosity, I just did a small benchmark (criterion) using the input.txt provided, and reordering results in a 10% difference:
This feels weird since the input.txt contains few pairs of equal characters, so there is likely something else going on. The inequality is very inexpensive but the ignore case compare should not be that expensive either.