• Rob Pike's avatar
    regexp/syntax: don't waste time checking for one pass algorithm · f54f790a
    Rob Pike authored
    The code recurs very deeply in cases like (?:x{1,1000}){1,1000}
    Since if much time is spent checking whether one pass is possible, it's not
    worth doing at all, a simple fix is proposed: Stop if the check takes too long.
    To do this, we simply avoid machines with >1000 instructions.
    
    Benchmarks show a percent or less change either way, effectively zero.
    
    Fixes #7608.
    
    LGTM=rsc
    R=rsc
    CC=golang-codereviews
    https://golang.org/cl/92290043
    f54f790a
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...