Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janos/distance
https://github.com/janos/distance
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/janos/distance
- Owner: janos
- License: bsd-3-clause
- Created: 2016-10-16T17:17:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-19T09:08:39.000Z (almost 5 years ago)
- Last Synced: 2024-06-21T18:08:25.321Z (5 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Distance
[![GoDoc](https://godoc.org/resenje.org/distance?status.svg)](https://godoc.org/resenje.org/distance)
Distance is a Go package with functions to calculate Hamming distance between two byte slices or unsigned integers, population (1 bite) count of byte slices or unsigned integers, and to XOR two byte slices.
## Benchmarks
Benchmarks on MacBook Pro 15'' (Mid 2014):
BenchmarkPopCountUint64-8 1000000000 0.299 ns/op 0 B/op 0 allocs/op
BenchmarkPopCount8Bytes-8 170056086 7.28 ns/op 0 B/op 0 allocs/op
BenchmarkXOR8Bytes-8 126639039 9.45 ns/op 0 B/op 0 allocs/op
BenchmarkHamming1Byte-8 219764226 5.42 ns/op 0 B/op 0 allocs/op
BenchmarkHamming8Bytes-8 141195171 8.59 ns/op 0 B/op 0 allocs/op
BenchmarkHamming16Bytes-8 92126083 12.4 ns/op 0 B/op 0 allocs/op
BenchmarkHamming32Bytes-8 56141322 20.2 ns/op 0 B/op 0 allocs/op
BenchmarkHamming33Bytes-8 53014400 20.8 ns/op 0 B/op 0 allocs/op
BenchmarkHamming64Bytes-8 31677573 35.8 ns/op 0 B/op 0 allocs/op
BenchmarkHamming128Bytes-8 17375133 67.1 ns/op 0 B/op 0 allocs/op
BenchmarkHamming1KBytes-8 2557718 458 ns/op 0 B/op 0 allocs/op
BenchmarkHamming10KBytes-8 257976 4370 ns/op 0 B/op 0 allocs/op
BenchmarkHamming1MByte-8 2464 444376 ns/op 0 B/op 0 allocs/op## License
Source files are distributed under the BSD-style license found in the LICENSE file.