Skip to content

Conversation

@randomizedcoder
Copy link

G'day team,

Thanks for this really cool project.

I was wondering about performance, so I started writing a little benchmark and thought maybe others would benefit also.

This isn't great, and I'm sure you can do better, but at least it's something.

das@das-dell5580:~/go/src/github.com/randomizedcoder/go-iptree/iptree$ go test -bench=.
benchmarkLookup maxIP: 30 lookups: 1000
ip trie loaded with: 707281
goos: linux
goarch: amd64
pkg: github.com/zmap/go-iptree/iptree
BenchmarkLookupA-4 benchmarkLookup maxIP: 30 lookups: 1000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000
ip trie loaded with: 707281
1000000000 0.000780 ns/op
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
BenchmarkLookupB-4 benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
benchmarkLookup maxIP: 30 lookups: 1000000
ip trie loaded with: 707281
268 4746592 ns/op
benchmarkLookup maxIP: 30 lookups: 10000000
ip trie loaded with: 707281
BenchmarkLookupC-4 1 10437866110 ns/op
PASS
ok github.com/zmap/go-iptree/iptree 47.608s

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.

2 participants