go-glob icon indicating copy to clipboard operation
go-glob copied to clipboard

Add an ability to prepare (compile) pattern before glob

Open vasayxtx opened this issue 5 years ago • 0 comments

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

vasayxtx avatar Sep 09 '20 14:09 vasayxtx