summaryrefslogtreecommitdiff
path: root/src/pkg/xml/xml.go
diff options
context:
space:
mode:
authorKyle Consalus <consalus@gmail.com>2010-06-02 23:04:44 -0700
committerKyle Consalus <consalus@gmail.com>2010-06-02 23:04:44 -0700
commit782ef98ee931b10e8454928455f93cf5859ac361 (patch)
treef60b39fd63f570b1ad794fdcea8d6ac315820c64 /src/pkg/xml/xml.go
parent164ca008324c94078c26d32252bf314b5c933936 (diff)
downloadgolang-782ef98ee931b10e8454928455f93cf5859ac361.tar.gz
Optimization to regexp _CharClass: keep track of overall range of
charclass to avoid unnecessarily iterating over ranges. Also, use the fact that IntVector is an []int to avoid method calls. On my machine, this brings us from ~27500 ns/op to ~17500 ns/op in the benchmark I've added (it is also faster in the case where a range check doesn't help, added a benchmark for this too.) I'd also like to propose that "[]", and "[^]" be disallowed. They aren't useful as far as I can tell, they aren't widely supported, and they make reasoning about character classes a bit more complicated. R=r CC=golang-dev http://codereview.appspot.com/1495041 Committer: Rob Pike <r@golang.org>
Diffstat (limited to 'src/pkg/xml/xml.go')
0 files changed, 0 insertions, 0 deletions