1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/mbstring
Niels Dossche 803cd824e5 Optimizations for mb_trim (#12803)
* Fast path for when there is nothing to trim in mb_trim

* Make mb_trim decide between linear search vs hash table lookup

Using empirical experiments I noticed that on my i7-4790 the hash table
approach becomes faster once we have more than 4 code points in the trim
characters, when evaluated on the worst case.

This patch changes the logic so that a hash table is used for a large
number of trim characters, and linear search when the number of trim
characters is <= 4.
2023-11-28 19:49:36 +01:00
..
2023-11-28 19:49:36 +01:00
2023-11-27 21:20:38 +02:00
2023-11-28 19:49:36 +01:00
2023-11-27 21:20:38 +02:00
2021-09-20 09:58:20 +02:00