go-glob
go-glob copied to clipboard
Add an ability to prepare (compile) pattern before glob
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