Seems reasonable (although I must add that if you have a situation where
the overhead of lexing your templates is significant, you must be doing
something odd). Feel free to send a CL.
-rob
On Mon, Jul 11, 2016 at 1:28 PM, 'Paul Borman' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> H
Here are a set of results using benchcmp. I also included a new benchmark,
the code from example_test.go that executes a template 3 times with
different input. The template is:
Dear {{.Name}},
{{if .Attended}}
It was a pleasure to see you at the wedding.
{{- else}}
It is a shame you couldn't mak
I was looking at text/template/parse/lex.go and noticed it seemed to be
very inefficient in how it searched for {{ in its input. I rewrote lexText
to us strings.Index rather than calling l.next() for every single rune in
the string. The results were up to a 9x speed improvement, depending on
the