This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] More regex microoptimization
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Bonzini <bonzini at gnu dot org>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Wed, 10 Mar 2004 11:09:48 -0800
- Subject: Re: [PATCH] More regex microoptimization
- Organization: Red Hat, Inc.
- References: <20040310113331.GA5994@fencepost>
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 â