mirror of
https://github.com/MariaDB/server.git
synced 2026-01-29 23:09:08 +01:00
Removing the function my_uca_level_booster_equal_prefix_length().
It was useful only in rare cases, when comparing two equal strings.
Adding a more useful function instead:
my_uca_level_booster_simple_prefix_cmp()
It optimizes well the case when different strings with a simple
prefix are compared.
"Simple" means that prefixes must have the following data:
- The data can be traversed two bytes at a time, i.e.:
* Every two bytes are either two ASCII characters or one 2-byte character
* There are no two-byte characters at an odd octet position
* There are no ASCII contraction heads at an odd octet position
- Each two bytes producing one or two weights
When either of the two prefixes become non-simple, the comparison
switches to the slower loop.
The timing of this query:
SELECT BENCHMARK(1000000000,strcmp('aaaaaaaa','aaaaaaab'));
changed from 11.084 seconds to 8.488 seconds on my desktop.
|
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| json-t.c | ||
| strings-t.c | ||