]> Cypherpunks repositories - gostls13.git/commit
exp/regexp: implement regexp API using exp/regexp/syntax
authorRuss Cox <rsc@golang.org>
Sun, 24 Jul 2011 21:00:28 +0000 (17:00 -0400)
committerRuss Cox <rsc@golang.org>
Sun, 24 Jul 2011 21:00:28 +0000 (17:00 -0400)
commita1e7cd97d509bae39d9e6a964b8920b1863a4e22
treefcc45349ae07e83ca13de9e0f9b155336abf0eee
parentfc2480da3c759dc444993d8e4b11ab5fe0777406
exp/regexp: implement regexp API using exp/regexp/syntax

Still need to write tests for new syntax
and fix bugs that the tests find, but this
is a good check point.

All tests pass.

Compared against existing regexp:

benchmark                                old ns/op    new ns/op    delta
regexp.BenchmarkLiteral                       1869          620  -66.83%
regexp.BenchmarkNotLiteral                    9489         7823  -17.56%
regexp.BenchmarkMatchClass                   10372         8386  -19.15%
regexp.BenchmarkMatchClass_InRange           10800         7750  -28.24%
regexp.BenchmarkReplaceAll                   13492         8519  -36.86%
regexp.BenchmarkAnchoredLiteralShortNonMatch   747          339  -54.62%
regexp.BenchmarkAnchoredLiteralLongNonMatch    599          335  -44.07%
regexp.BenchmarkAnchoredShortMatch            2137          917  -57.09%
regexp.BenchmarkAnchoredLongMatch             2029          917  -54.81%

R=r, r
CC=golang-dev, sam.thorogood
https://golang.org/cl/4820046
src/pkg/exp/regexp/Makefile [new file with mode: 0644]
src/pkg/exp/regexp/all_test.go [new file with mode: 0644]
src/pkg/exp/regexp/exec.go [new file with mode: 0644]
src/pkg/exp/regexp/find_test.go [new file with mode: 0644]
src/pkg/exp/regexp/regexp.go [new file with mode: 0644]
src/pkg/exp/regexp/syntax/compile.go
src/pkg/exp/regexp/syntax/prog.go