From 015b706bcaaa16306e28e87abc28f02d7d916a84 Mon Sep 17 00:00:00 2001 From: "s.kamardin" Date: Mon, 30 Nov 2015 18:30:08 +0300 Subject: [PATCH] Update readme --- readme.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index df10b39..66e4ec2 100644 --- a/readme.md +++ b/readme.md @@ -47,4 +47,17 @@ func main() { g.Match("at") // false } -``` \ No newline at end of file +``` + +## Performance + +In comparison with [go-glob](https://github.com/ryanuber/go-glob), it is ~2.7x faster (on my personal Mac), +because my glob is compiling patterns for multiple usages. If you will not use compiled `glob.Glob` object, +and do `g := glob.New(pattern); g.Match(...)` every time, then your code will be about ~3x slower. + +Run `go test bench=.` from source root to see the benchmarks: + +Test | Operations | Speed +-----|------------|------ +github.com/gobwas/glob | 20000000 | 165 ns/op +github.com/ryanuber/go-glob | 10000000 | 452 ns/op \ No newline at end of file