| Summary: | [PATCH] Speed ups for regex! | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | howardjp <howardjp> | ||||
| Component: | bin | Assignee: | dcs <dcs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.0-CURRENT | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
howardjp
1999-10-15 05:50:00 UTC
Responsible Changed From-To: freebsd-bugs->dcs dcs is working on this I can see a number of bugs with the patch. Cmap isn't properly initialized, there is a reference to a "string" not mentioned elsewhere, there is a reference to altlen[N], altpat[N] but only altlen[0] and altpat[0] are actually used. The code compares must to cmap at regexec() time, when they are both defined at regcomp() and not changed after that! In other words... you trimmed too much. :-) On the more problematic side, this imposes a limit on the size of both text and pattern, something which the present code has not. Finally, this is not, strictly speaking, the Boyer-Moore algorithm. It only checks the last character of the must pattern, and, obviously doesn't even have a provision for match jumps. And it must be pointed out that the Boyer-Moore algorithm is much worse than the straight-forward algorithm for patterns <= 3 characters in length. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@yet.another.bsdconspiracy.org Hmmm - I have to go check this. My reality assumptions are shattered. State Changed From-To: open->closed A Boyer-Moore algorithm was added. Thanks. |