• Rob Pike's avatar
    regexp: speed up by about 30%. · 8bb9e616
    Rob Pike authored
    The code used interfaces in a pretty, pedagogical way but not efficiently.
    Remove unnecessary interface code for significant speedups.
    Before:
    
    	regexp.BenchmarkLiteral	 1000000	      2629 ns/op
    	regexp.BenchmarkNotLiteral	  100000	     18131 ns/op
    	regexp.BenchmarkMatchClass	  100000	     26647 ns/op
    	regexp.BenchmarkMatchClass_InRange	  100000	     27092 ns/op
    	regexp.BenchmarkReplaceAll	  100000	     27014 ns/op
    
    After:
    
    	regexp.BenchmarkLiteral	 1000000	      2077 ns/op
    	regexp.BenchmarkNotLiteral	  100000	     13738 ns/op
    	regexp.BenchmarkMatchClass	  100000	     20418 ns/op
    	regexp.BenchmarkMatchClass_InRange	  100000	     20999 ns/op
    	regexp.BenchmarkReplaceAll	  100000	     21825 ns/op
    
    There's likely more to do without major surgery, but this is a simple, significant step.
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/3572042
    8bb9e616
Name
Last commit
Last update
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...