-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazily initialize regexes to speed up init()
#1246
Conversation
init()
init()
@kylecarbs out of curiosity, what is your use case where |
@deankarn this package is imported in our CLI. Adding that overhead to every invocation (even help) isn't great. |
@deankarn any changes needed for me to push this through? |
@kylecarbs sorry for the lateness of my reply, been busy. My only concern is the |
@deankarn good idea. Will change in a bit! |
I will check back later tonight/tomorrow :) |
Using `GODEBUG=inittrace=1` I found a relatively constant 10ms init caused by this function. Replaces go-playground#1246.
Using
GODEBUG=inittrace=1
I found a relatively constant 10ms init caused by this function.@go-playground/validator-maintainers