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

v0.2.0 #8

Open
6 of 7 tasks
kawasin73 opened this issue Nov 9, 2018 · 1 comment
Open
6 of 7 tasks

v0.2.0 #8

kawasin73 opened this issue Nov 9, 2018 · 1 comment
Assignees

Comments

@kawasin73
Copy link
Owner

kawasin73 commented Nov 9, 2018

v0.2.0 を実装する

v0.1.0 #1 で実装したメソッドを最適化する

最適化

  • Set の最適化
  • Unset の最適化
  • Get の最適化
  • FindFirstZero の検索範囲上限の設定
  • バイト列の自動拡張 バイト列の自動拡張 #6

インターフェイス

  • HostEndian()

その他

@kawasin73 kawasin73 self-assigned this Nov 12, 2018
@kawasin73
Copy link
Owner Author

Set, Unset, Get の最適化

最適化前

$ go test -bench=.
goos: darwin
goarch: amd64
pkg: github.com/kawasin73/bitset
BenchmarkBitVec_Set_LittleEndian-4     	300000000	         5.25 ns/op
BenchmarkBitVec_Set_BigEndian-4        	100000000	        13.6 ns/op
BenchmarkBitVec_Unset_LittleEndian-4   	300000000	         5.83 ns/op
BenchmarkBitVec_Unset_BigEndian-4      	100000000	        14.4 ns/op
BenchmarkBitVec_Get_LittleEndian-4     	300000000	         4.94 ns/op
BenchmarkBitVec_Get_BigEndian-4        	200000000	         8.13 ns/op
BenchmarkSwap-4                        	2000000000	         1.16 ns/op
PASS
ok  	github.com/kawasin73/bitset	14.218s

最適化後

$ go test -bench=.
goos: darwin
goarch: amd64
pkg: github.com/kawasin73/bitset
BenchmarkBitVec_Set_LittleEndian-4     	500000000	         3.06 ns/op
BenchmarkBitVec_Set_BigEndian-4        	300000000	         4.10 ns/op
BenchmarkBitVec_Unset_LittleEndian-4   	500000000	         3.38 ns/op
BenchmarkBitVec_Unset_BigEndian-4      	300000000	         4.09 ns/op
BenchmarkBitVec_Get_LittleEndian-4     	1000000000	         1.99 ns/op
BenchmarkBitVec_Get_BigEndian-4        	1000000000	         2.04 ns/op
BenchmarkSwap-4                        	2000000000	         1.27 ns/op
PASS
ok  	github.com/kawasin73/bitset	14.289s

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

1 participant