reduce allocation in funcStrip
benchmark old ns/op new ns/op delta
BenchmarkFuncStrip 468 334 -28.63%
benchmark old allocs new allocs delta
BenchmarkFuncStrip 1 0 -100.00%
benchmark old bytes new bytes delta
BenchmarkFuncStrip 32 0 -100.00%
diff --git a/func_test.go b/func_test.go
index 7778125..07b00a0 100644
--- a/func_test.go
+++ b/func_test.go
@@ -30,6 +30,8 @@
}
ev := newEvaluator(make(map[string]Var))
var buf bytes.Buffer
+ b.ReportAllocs()
+ b.ResetTimer()
for i := 0; i < b.N; i++ {
buf.Reset()
strip.Eval(&buf, ev)