go/src/text
Paul Borman 07b8011393 text/template: improve lexer performance in finding left delimiters.
The existing implementation calls l.next for each run up to the next
instance of the left delimiter ({{).  For ascii text, this is multiple
function calls per byte.  Change to use strings.Index to find the left
delimiter.  The performace improvement ranges from 1:1 (no text outside
of {{}}'s) to multiple times faster (9:1 was seen on 8K of text with no
{{ }}'s).

Change-Id: I2f82bea63b78b6714f09a725f7b2bbb00a3448a3
Reviewed-on: https://go-review.googlesource.com/24863
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
2016-09-13 12:51:13 +00:00
..
scanner text/scanner: better error message if no error handler is installed 2016-05-25 15:44:28 +00:00
tabwriter all: remove public named return values when useless 2016-02-29 03:31:19 +00:00
template text/template: improve lexer performance in finding left delimiters. 2016-09-13 12:51:13 +00:00