]> Cypherpunks repositories - gostls13.git/commit
exp/html: change a node's children from a slice to a linked list.
authorNigel Tao <nigeltao@golang.org>
Fri, 31 Aug 2012 00:00:12 +0000 (10:00 +1000)
committerNigel Tao <nigeltao@golang.org>
Fri, 31 Aug 2012 00:00:12 +0000 (10:00 +1000)
commit13cf2473b8b617a3e800a22b810a5a13030d4cb6
tree063157429c077ca9a1ba77520c4d9235c056f67c
parentd6c69dc602431828c5e5818b24bbf0593652480c
exp/html: change a node's children from a slice to a linked list.

Also rename Node.{Add,Remove} to Node.{AppendChild,RemoveChild} to
be consistent with the DOM.

benchmark                      old ns/op    new ns/op    delta
BenchmarkParser                  4042040      3749618   -7.23%

benchmark                       old MB/s     new MB/s  speedup
BenchmarkParser                    19.34        20.85    1.08x

BenchmarkParser mallocs per iteration is also:
10495 before / 7992 after

R=andybalholm, r, adg
CC=golang-dev
https://golang.org/cl/6495061
src/pkg/exp/html/node.go
src/pkg/exp/html/node_test.go [new file with mode: 0644]
src/pkg/exp/html/parse.go
src/pkg/exp/html/parse_test.go
src/pkg/exp/html/render.go
src/pkg/exp/html/render_test.go