Improve rendering time
authorNoah Campbell <noahcampbell@gmail.com>
Fri, 1 Nov 2013 05:14:11 +0000 (22:14 -0700)
committerNoah Campbell <noahcampbell@gmail.com>
Fri, 1 Nov 2013 16:59:57 +0000 (09:59 -0700)
commit9af47f07d3f9700e233a98d7e84d85c3a30f9cd5
tree13df4879bf1bf5f895d74029086dfce5a6b60c04
parentf4cb8e1688b1459472413f3c85cb3b6297397020
Improve rendering time

50% speedup.  Fix #91

to run the benchmark:

go test -test.run=NONE -bench=".*" -test.benchmem=true ./transform/ > new.txt

to compare the results:

/usr/local/go/misc/benchcmp baseline.txt new.txt

Speedup and memory improvements

benchmark             old ns/op    new ns/op    delta
BenchmarkChain           101219        50453  -50.15%
BenchmarkTransform        51625        45531  -11.80%

benchmark            old allocs   new allocs    delta
BenchmarkChain              222          103  -53.60%
BenchmarkTransform          135          106  -21.48%

benchmark             old bytes    new bytes    delta
BenchmarkChain            23919        10998  -54.02%
BenchmarkTransform        11858        10665  -10.06%
baseline.txt
hugolib/site.go
transform/absurl.go
transform/chain.go
transform/chain_test.go
transform/nav.go
transform/nav_test.go
transform/post.go
transform/posttrans_test.go