|
|
|
|
|
by silisili
1729 days ago
|
|
> They stopped compiling regexps on the fly and moved the regexps to package variables. (I actually don't know if this was a significant win; there might just be the three big wins.) Anecdotally, this could be a huge win, depending on how often it's called. A guy I was working with, new to Go, was writing a router config parser and asked why it was so slow. The first thing I did was moved regexp.Compile from a hot path into a broader scope. It went from something like 40 seconds down to 2 on my machine. |
|
It would probably be a good idea to add performance hints like 'prefer to put static regular expressions in a package variable' in a linter or go vet.