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

Upgraded bitmap #10

Merged
merged 1 commit into from
Jun 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *Collection) findFreeIndex(count uint64) uint32 {
}

// Otherwise, we scan the fill bitmap until we find the first zero.
idx, _ := c.fill.FirstZero()
idx, _ := c.fill.MinZero()
return idx
}

Expand Down
2 changes: 1 addition & 1 deletion collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
cpu: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
BenchmarkCollection/insert-8 5531546 215.9 ns/op 18 B/op 0 allocs/op
BenchmarkCollection/fetch-8 23749724 44.97 ns/op 0 B/op 0 allocs/op
BenchmarkCollection/scan-8 784 1527506 ns/op 160 B/op 0 allocs/op
BenchmarkCollection/scan-8 855 1388532 ns/op 88 B/op 0 allocs/op
BenchmarkCollection/count-8 1000000 1081 ns/op 0 B/op 0 allocs/op
BenchmarkCollection/range-8 10000 100833 ns/op 14 B/op 0 allocs/op
BenchmarkCollection/update-at-8 4225484 281.7 ns/op 0 B/op 0 allocs/op
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ go 1.16

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kelindar/bitmap v1.0.9
github.com/kelindar/bitmap v1.0.12
github.com/stretchr/testify v1.7.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kelindar/bitmap v1.0.9 h1:jVaK6cdq9uvjK0ZsZT6oLRCfad1KnZLRcAWk99b4Z6Q=
github.com/kelindar/bitmap v1.0.9/go.mod h1:shAFyS8BOif+pvJ05GqxnCM0SdohHQjKvDetqI/9z6M=
github.com/kelindar/bitmap v1.0.12 h1:MD696wPzddmfP/XrSm+kApsfVNJ5muR/2Sb2VAf+8QE=
github.com/kelindar/bitmap v1.0.12/go.mod h1:shAFyS8BOif+pvJ05GqxnCM0SdohHQjKvDetqI/9z6M=
github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI=
github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down