]> Cypherpunks repositories - gostls13.git/commit
exp/html: make the tokenizer return atoms for tag tokens.
authorNigel Tao <nigeltao@golang.org>
Thu, 7 Jun 2012 03:05:35 +0000 (13:05 +1000)
committerNigel Tao <nigeltao@golang.org>
Thu, 7 Jun 2012 03:05:35 +0000 (13:05 +1000)
commitcd21eff70520a433f6ee67819e539b2ebe043120
tree21b470d3678961953fc16b1585fb0ee6dd956fd7
parent64236820193864cdb6ad28dc475626337cf18a23
exp/html: make the tokenizer return atoms for tag tokens.

This is part 1 of a 2 part changelist. Part 2 contains the mechanical
change to parse.go to compare atoms (ints) instead of strings.

The overall effect of the two changes are:
benchmark                      old ns/op    new ns/op    delta
BenchmarkParser                  4462274      4058254   -9.05%
BenchmarkRawLevelTokenizer        913202       912917   -0.03%
BenchmarkLowLevelTokenizer       1268626      1267836   -0.06%
BenchmarkHighLevelTokenizer      1947305      1968944   +1.11%

R=rsc
CC=andybalholm, golang-dev, r
https://golang.org/cl/6305053
src/pkg/exp/html/node.go
src/pkg/exp/html/parse.go
src/pkg/exp/html/parse_test.go
src/pkg/exp/html/token.go