New Upstream Release - golang-github-spaolacci-murmur3
Ready changes
Summary
Merged new upstream version: 1.1.0 (was: 1.1).
Resulting package
Built on 2022-03-14T12:19 (took 1m45s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases golang-github-spaolacci-murmur3-dev
Lintian Result
Diff
diff --git a/debian/changelog b/debian/changelog
index 3718da7..53c460a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-spaolacci-murmur3 (1.1.0-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Mon, 14 Mar 2022 12:17:35 -0000
+
golang-github-spaolacci-murmur3 (1.1-3) unstable; urgency=medium
* Vcs-* urls: pkg-go-team -> go-team.
diff --git a/murmur_test.go b/murmur_test.go
index fe564d0..94e2ee1 100644
--- a/murmur_test.go
+++ b/murmur_test.go
@@ -2,6 +2,7 @@ package murmur3
import (
"fmt"
+ "strconv"
"testing"
)
@@ -113,153 +114,72 @@ func TestIncremental(t *testing.T) {
}
}
-//---
-
-func bench32(b *testing.B, length int) {
- buf := make([]byte, length)
- b.SetBytes(int64(length))
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- Sum32(buf)
+func Benchmark32(b *testing.B) {
+ buf := make([]byte, 8192)
+ for length := 1; length <= cap(buf); length *= 2 {
+ b.Run(strconv.Itoa(length), func(b *testing.B) {
+ buf = buf[:length]
+ b.SetBytes(int64(length))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ Sum32(buf)
+ }
+ })
}
}
-func Benchmark32_1(b *testing.B) {
- bench32(b, 1)
-}
-func Benchmark32_2(b *testing.B) {
- bench32(b, 2)
-}
-func Benchmark32_4(b *testing.B) {
- bench32(b, 4)
-}
-func Benchmark32_8(b *testing.B) {
- bench32(b, 8)
-}
-func Benchmark32_16(b *testing.B) {
- bench32(b, 16)
-}
-func Benchmark32_32(b *testing.B) {
- bench32(b, 32)
-}
-func Benchmark32_64(b *testing.B) {
- bench32(b, 64)
-}
-func Benchmark32_128(b *testing.B) {
- bench32(b, 128)
-}
-func Benchmark32_256(b *testing.B) {
- bench32(b, 256)
-}
-func Benchmark32_512(b *testing.B) {
- bench32(b, 512)
-}
-func Benchmark32_1024(b *testing.B) {
- bench32(b, 1024)
-}
-func Benchmark32_2048(b *testing.B) {
- bench32(b, 2048)
-}
-func Benchmark32_4096(b *testing.B) {
- bench32(b, 4096)
-}
-func Benchmark32_8192(b *testing.B) {
- bench32(b, 8192)
-}
-
-//---
+func BenchmarkPartial32(b *testing.B) {
+ buf := make([]byte, 128)
+ for length := 8; length <= cap(buf); length *= 2 {
+ b.Run(strconv.Itoa(length), func(b *testing.B) {
+ buf = buf[:length]
+ b.SetBytes(int64(length))
-func benchPartial32(b *testing.B, length int) {
- buf := make([]byte, length)
- b.SetBytes(int64(length))
+ start := (32 / 8) / 2
+ chunks := 7
+ k := length / chunks
+ tail := (length - start) % k
- start := (32 / 8) / 2
- chunks := 7
- k := length / chunks
- tail := (length - start) % k
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ hasher := New32()
+ hasher.Write(buf[0:start])
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- hasher := New32()
- hasher.Write(buf[0:start])
+ for j := start; j+k <= length; j += k {
+ hasher.Write(buf[j : j+k])
+ }
- for j := start; j+k <= length; j += k {
- hasher.Write(buf[j : j+k])
- }
-
- hasher.Write(buf[length-tail:])
- hasher.Sum32()
+ hasher.Write(buf[length-tail:])
+ hasher.Sum32()
+ }
+ })
}
}
-func BenchmarkPartial32_8(b *testing.B) {
- benchPartial32(b, 8)
-}
-func BenchmarkPartial32_16(b *testing.B) {
- benchPartial32(b, 16)
-}
-func BenchmarkPartial32_32(b *testing.B) {
- benchPartial32(b, 32)
-}
-func BenchmarkPartial32_64(b *testing.B) {
- benchPartial32(b, 64)
-}
-func BenchmarkPartial32_128(b *testing.B) {
- benchPartial32(b, 128)
-}
-
-//---
-
-func bench128(b *testing.B, length int) {
- buf := make([]byte, length)
- b.SetBytes(int64(length))
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- Sum128(buf)
+func Benchmark64(b *testing.B) {
+ buf := make([]byte, 8192)
+ for length := 1; length <= cap(buf); length *= 2 {
+ b.Run(strconv.Itoa(length), func(b *testing.B) {
+ buf = buf[:length]
+ b.SetBytes(int64(length))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ Sum64(buf)
+ }
+ })
}
}
-func Benchmark128_1(b *testing.B) {
- bench128(b, 1)
-}
-func Benchmark128_2(b *testing.B) {
- bench128(b, 2)
-}
-func Benchmark128_4(b *testing.B) {
- bench128(b, 4)
-}
-func Benchmark128_8(b *testing.B) {
- bench128(b, 8)
-}
-func Benchmark128_16(b *testing.B) {
- bench128(b, 16)
-}
-func Benchmark128_32(b *testing.B) {
- bench128(b, 32)
-}
-func Benchmark128_64(b *testing.B) {
- bench128(b, 64)
-}
-func Benchmark128_128(b *testing.B) {
- bench128(b, 128)
-}
-func Benchmark128_256(b *testing.B) {
- bench128(b, 256)
-}
-func Benchmark128_512(b *testing.B) {
- bench128(b, 512)
-}
-func Benchmark128_1024(b *testing.B) {
- bench128(b, 1024)
-}
-func Benchmark128_2048(b *testing.B) {
- bench128(b, 2048)
-}
-func Benchmark128_4096(b *testing.B) {
- bench128(b, 4096)
-}
-func Benchmark128_8192(b *testing.B) {
- bench128(b, 8192)
+func Benchmark128(b *testing.B) {
+ buf := make([]byte, 8192)
+ for length := 1; length <= cap(buf); length *= 2 {
+ b.Run(strconv.Itoa(length), func(b *testing.B) {
+ buf = buf[:length]
+ b.SetBytes(int64(length))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ Sum128(buf)
+ }
+ })
+ }
}
-
-//---
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files