Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmarkLookup #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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.

1 participant