Orton, Yves wrote:
[...]
<shameless plug>
But David and the other Regexp authors need to update their code to take advantage of 5.9.2 and later innate TRIE optimisation. They still have room for optimising the patterns that they build but they will need to build fairly different looking patterns to really harness the TRIE regop.


</shameless plug>

No, I've been following the threads on p5p. I've been looking hard at the stuff I do, and the patterns I generate come from little patterns that all tend to feature lots of metacharacters (otherwise I'd be doing hash lookups or index()), correct me if I'm wrong, such patterns don't benefit from your trie optimisations. E.g., what happens with


FROM MRS\. [A-Z]+ [A-Z]+
FROM MRS [A-Z]+ [A-Z]+
FROM MR [A-Z]+ [A-Z]+
FROM MR\. [A-Z]+ [A-Z]+
FROM: MRS\. [A-Z]+ [A-Z]+
FROM: MRS [A-Z]+ [A-Z]+
FROM: MR [A-Z]+ [A-Z]+
FROM: MR\. [A-Z]+ [A-Z]+

(actual patterns lifted from Nigerian spam). R::A produces

FROM:? MRS?\.? [A-Z]+ [A-Z]+

Instead of the whole mess or'ed together. I'm seriously lacking time to benchmark the differences.

David



Reply via email to