mariadb/unittest/strings
Alexander Barkov 3a13f814b0 MDEV-37849 UCA: Change "skip equal simple prefix" to "compare simple prefix"
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.
2025-11-11 09:44:38 +04:00
..
CMakeLists.txt Cleanup Whitespace in unittest/ directory 2024-07-25 00:28:02 +10:00
json-t.c stricter json unit tests 2019-02-04 15:54:10 +01:00
strings-t.c MDEV-37849 UCA: Change "skip equal simple prefix" to "compare simple prefix" 2025-11-11 09:44:38 +04:00