[PATCH] More regex microoptimization

Ulrich Drepper drepper@redhat.com
Wed Mar 10 19:10:00 GMT 2004


Bonzini wrote:

> 1) add several __builtin_expect predictions.  Most are that
> mb_cur_max == 1, that matching is case sensitive and no translation
> table is used.  This is true for all three of sed, awk and grep
> by default.  Every group of predictions was checked one by one.

The mb_cur_max preference is wrong.  This "optimization" is only good
for profiling the test suite.  In the "real world" UTF-8 is now the
predominent encoding for a locale which means these conditions would be
mispredicted almost all the time and slowing down normal operations.

If you remove those __builtin_expect uses I'll apply the patch.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖



More information about the Libc-alpha mailing list