Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Precompile regex #20

Closed
dim opened this issue Nov 2, 2015 · 1 comment
Closed

Precompile regex #20

dim opened this issue Nov 2, 2015 · 1 comment

Comments

@dim
Copy link

dim commented Nov 2, 2015

Instead of compiling the regular expressions on each cycle, you should precompile them for improved performance, i.e.:

Instead of:

reg, _ := regexp.Compile("^rv:(.+)$")

You should declare a global and reusable:

var rvReg = regexp.MustCompile("^rv:(.+)$")
@mssola mssola closed this as completed in 783ec61 Nov 7, 2015
@mssola
Copy link
Owner

mssola commented Nov 7, 2015

@dim Thanks for the suggestion :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants