This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug regex/501] transit_state is slow


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]