This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug regex/501] transit_state is slow
- From: "bonzini at gnu dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 10 Nov 2004 14:18:58 -0000
- Subject: [Bug regex/501] transit_state is slow
- References: <20041104085106.501.bonzini@gnu.org>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From bonzini at gnu dot org 2004-11-10 14:18 -------
The best path with my patch is
trtable = state->trtable;
if (BE (trtable != NULL, 1))
return trtable[ch];
versus
trtable = state->trtable;
if (trtable == NULL)
...
if (BE (state->word_trtable, 0))
...
else
return trtable[ch];
where state->word_trtable was a bitfield. Removing the access to this bitfield
does make a difference of about 3-4% on some regexps because this is a very busy
path. A regexp which benefits from this is simply .*; an NFA matcher can do
this in O(1) time, while we are bound to O(N) anyway, so it is important to make
it as fast as possible.
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=501
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.