Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
zero allocs/op...いいよね...
Browse files Browse the repository at this point in the history
  • Loading branch information
ledyba committed Oct 11, 2019
1 parent a7f1f90 commit 2e9857f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ It runs faster than [trie to regex](http://google.com/search?q=trie+2+regex) app

Please see [rival](https://github.com/ledyba/go-trie/tree/master/_rivals) directory to benchmarks in other languages.

## benchmark

```bash
% make bench
- php's trie2regex: 742.64 us/op (10000 times)
Expand All @@ -19,6 +21,21 @@ Please see [rival](https://github.com/ledyba/go-trie/tree/master/_rivals) direct
- go-trie: 24.28 us/op (x 100.40) (100000 times)
```
## zero heap allocation
`Contains(string)` and `Match(string)` operation do not allocate heaps:
```bash
% go test -benchmem -bench .
goos: linux
goarch: amd64
pkg: github.com/ledyba/go-trie/matchers/trie
BenchmarkUnmatchTrie-32 48541 24728 ns/op 0 B/op 0 allocs/op
PASS
ok github.com/ledyba/go-trie/matchers/trie 4.086s
```
# how to use?
```go
Expand Down

0 comments on commit 2e9857f

Please sign in to comment.