Skip to content
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

Add an ability to prepare (compile) pattern before glob #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vasayxtx
Copy link

@vasayxtx vasayxtx commented Sep 9, 2020

Thanks for this simple library. I need to test matching a lot of strings with the same pattern, so for performance reasons, it would be better to prepare the last one before.
Microbench:

$ go version
go version go1.15.1 darwin/amd64

$ go test -bench=.
goos: darwin
goarch: amd64
pkg: github.com/ryanuber/go-glob
BenchmarkGlob-8                  5427961               219 ns/op
BenchmarkCompiledGlob-8         31287264                37.4 ns/op
PASS
ok      github.com/ryanuber/go-glob     2.814s

It's needed for performance sensitive cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant