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

maybe your test dataset range is too small. #9

Open
Ruth-Seven opened this issue Jul 26, 2021 · 1 comment
Open

maybe your test dataset range is too small. #9

Ruth-Seven opened this issue Jul 26, 2021 · 1 comment

Comments

@Ruth-Seven
Copy link

go test   . -bench=. -run=NOTEST  -v -cpuprofile=cpu.out -benchtime=1000000x
goos: darwin
goarch: amd64
pkg: github.com/skiplist
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkSkipListInsert
BenchmarkSkipListInsert-12                       1000000               224.7 ns/op
BenchmarkSkipListFind
BenchmarkSkipListFind-12                         1000000               151.9 ns/op
BenchmarkSkipListFindBiggerOrEqual
BenchmarkSkipListFindBiggerOrEqual-12            1000000               140.7 ns/op
BenchmarkSkipListDelete
BenchmarkSkipListDelete-12                       1000000                72.63 ns/op

go test   . -bench=. -run=NOTEST  -v -cpuprofile=cpu.out -benchtime=10000000x 
goos: darwin
goarch: amd64
pkg: github.com/skiplist
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkSkipListInsert
BenchmarkSkipListInsert-12                      10000000               224.0 ns/op
BenchmarkSkipListFind
BenchmarkSkipListFind-12                        10000000               163.9 ns/op
BenchmarkSkipListFindBiggerOrEqual
BenchmarkSkipListFindBiggerOrEqual-12           10000000               156.8 ns/op
BenchmarkSkipListDelete
BenchmarkSkipListDelete-12                      10000000                80.16 ns/op


go test   . -bench=. -run=NOTEST  -v -cpuprofile=cpu.out -benchtime=100000000x 
goos: darwin
goarch: amd64
pkg: github.com/skiplist
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkSkipListInsert
BenchmarkSkipListInsert-12                      100000000              329.4 ns/op
BenchmarkSkipListFind
BenchmarkSkipListFind-12                        100000000              369.1 ns/op
BenchmarkSkipListFindBiggerOrEqual
BenchmarkSkipListFindBiggerOrEqual-12           100000000              318.8 ns/op
BenchmarkSkipListDelete
BenchmarkSkipListDelete-12                      100000000              269.6 ns/op

relative code

@andersfylling
Copy link

It's documented in code that it's optimized for up till 34m entries. It would be very interesting to see how it scales compared to other algs, and how increasing the maxLevel constant respectively affects scaling.

// efficient for up to 34m entries. If there is a need for much more, please adjust this constant accordingly.

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

No branches or pull requests

2 participants