Skip to content

Commit ac446d1

Browse files
authored
Merge pull request #9 from fxamacker/fxamacker/update-ci-go-cover
Update ci-go-cover.yml and add CircleHash128 to TODOs
2 parents a5ac101 + 2f50678 commit ac446d1

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

.github/workflows/ci-go-cover.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,27 @@ jobs:
2121
# Verify minimum coverage is reached using `go test -short -cover` on latest-ubuntu with default version of Go.
2222
# The grep expression can't be too strict, it needed to be relaxed to work with different versions of Go.
2323
cover:
24-
name: Coverage
25-
runs-on: ubuntu-latest
24+
name: Coverage on ${{matrix.os}}
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix:
28+
# Only need one OS
29+
# Need at least one Go <= 1.16 until *_oldgo.go is removed or changes its build tag
30+
# Need at least one Go >= 1.17 until build tags require newer version or are removed
31+
os: [ubuntu-latest]
32+
go-version: [1.16.x, 1.17.x]
33+
2634
steps:
35+
- name: Install Go
36+
uses: actions/setup-go@v2
37+
with:
38+
go-version: ${{ matrix.go-version }}
39+
2740
- name: Checkout code
2841
uses: actions/checkout@v2
42+
with:
43+
fetch-depth: 1
44+
2945
- name: Go Coverage
3046
run: |
3147
go version

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CircleHash64 uses CircleHash64f by default, which is based on [Google's Abseil C
3131
| 192 bytes | 14.2 GB/s | 9.86 GB/s | 9.71 GB/s | 2.17 GB/s |
3232
| 256 bytes | 15.0 GB/s | 8.19 GB/s | 10.2 GB/s | 2.22 GB/s |
3333

34-
- Using Go 1.17.7 (benchstat output), darwin_amd64, i7-1068N7 CPU
34+
- Using Go 1.17.7, darwin_amd64, i7-1068N7 CPU
3535
- Fastest XXH64 (written in Go+Assembly) doesn't support seed.
3636

3737
ℹ️ Non-cryptographic hashes should only be used in software designed to properly handle hash collisions. If you require a secure hash, please use a cryptographic hash (like the ones in SHA-3 standard).
@@ -56,23 +56,15 @@ CircleHash64 comes in two flavors:
5656

5757
- 🚀 **CircleHash64f** can be configured to produce same digests as Abseil LTS 20210324.2. By default, CircleHash64f uses two different 64-bit constants rather than using the same 64-bit constant twice at finalization. And unlike internal hashes, CircleHash64f offers backward compatibility (SemVer 2.0).
5858

59-
CircleHash64 uses CircleHash64f by default and supports 64-bit seeds.
59+
CircleHash64 uses CircleHash64f by default and supports 64-bit seeds. It was created when I needed a very fast seeded hash for inputs mostly <= 128 bytes.
6060

61-
## CircleHash Speed in Go and C++
62-
63-
CircleHash64 is among the fastest hashes for short inputs. Unoptimized CircleHash64 in Go is faster than optimized XXH64 in Go+Assembly.
64-
65-
CircleHash64 is faster than executing this assignment just once in a Go program:
66-
67-
```Go
68-
foo = uint64_a % uint64_b // slower than CircleHash64f and CircleHash64fx on Haswell Xeon
69-
```
61+
## Benchmarks
7062

71-
Speeds were compared using Go 1.16.8 on linux_amd64 (Haswell CPU) with unoptimized CircleHash64. On newer Intel CPUs the modulus can be slightly faster.
63+
CircleHash64f is ideal for input sizes <= 512 bytes. Larger inputs can be hashed faster using other CircleHash designs (not yet published).
7264

73-
## Benchmarks
65+
For best results, it's better to do your own benchmarks using your own hardware and your most common data sizes.
7466

75-
Coming soon... For best results, it's better to do your own benchmarks using your own hardware and your most common data sizes.
67+
Coming soon...
7668

7769
## Status [DRAFT]
7870
- [x] dependable release policy: all tests must pass and enforce Semantic Versioning 2.0
@@ -94,9 +86,11 @@ Coming soon... For best results, it's better to do your own benchmarks using you
9486
- [ ] 32-bit archs
9587
- [ ] long-running collision tests (need big server 256 GB RAM)
9688
- [x] publish reference code for CircleHash64f in Go
89+
- [x] publish compatibility test vectors for CircleHash64f (see *_test.go)
90+
- [x] publish preliminary benchmarks comparisons for CircleHash64f reference implementation (Go without assembly language)
91+
- [ ] publish detailed benchmarks that include all input sizes <= 128 bytes (or <= 256 bytes if time allows)
9792
- [ ] publish reference code for CircleHash64fx in Go
98-
- [ ] publish compatibility test vectors for CircleHash64f
99-
- [ ] publish benchmarks for unoptimized CircleHash64 reference implementation (Go)
93+
- [ ] publish reference code for CircleHash128
10094
- [ ] provide implementations in other languages
10195
- [ ] provide optional functions for creating high quality seeds
10296
- [ ] provide optional functions for creating high quality constants (to override **π**)

0 commit comments

Comments
 (0)