|
|
|
|
|
by gregod
1958 days ago
|
|
Good point. Here it is premature optimization anyway and too dependent on the input. In general, I think a balance between likelihood and cost should be found. Out of curiosity, I just did a small benchmark (criterion) using the input.txt provided, and reordering results in a 10% difference: Old Order time:[307.28 us 309.12 us 311.17 us]
Reversed time:[270.82 us 271.18 us 271.54 us]
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. |
|