bumping golang.org/x/net 66e838c...e2310ae: > e2310ae go.mod: update golang.org/x dependencies > 77708f7 quic: skip tests which depend on unimplemented UDP functions on Plan 9 > 9617c63 http2: avoid Transport hang with Connection: close and AllowHTTP bumping golang.org/x/sys 673e0f9...faed7ec: > faed7ec unix: add PthreadChdir and PthreadFchdir on darwin > c892bb7 unix: fix MmapPtr test failing on OpenBSD > a0ef40a unix: fix MremapPtr test failing on NetBSD > daa2394 unix: add unsafe mmap, munmap, mremap > 7670087 windows: add GetAce Windows API > 348425a windows/svc: do not pass theService to windows.RegisterServiceCtrlHandlerEx bumping golang.org/x/tools bc6931d...33be3ef: > 33be3ef go.mod: update golang.org/x dependencies > 0e7ccc0 gopls/internal/golang: provide version info for stdlib in pkgdoc > fcf5463 gopls/internal/server: add counters to inform v0.17.0 > 70a59b2 gopls/doc: respond to Hana's review of CL 583316 > 799a471 gopls/doc: document all of gopls' features > 2e239ad gopls/internal/golang: provide version info for stdlib fields > bc15dd8 gopls/internal/analysis/fillstruct: use package name (not path) in UI > 72edac2 internal/typeparams: fix crash in interface hover with empty type set > c0ae6bb gopls/internal/golang: splitlines: s/parameter/arguments/ in CallExpr > 5cc2d0b gopls/internal/golang: splitlines: remove workaround for golang/go# 68202 > 6916077 gopls/internal/golang: don't panic when findKeyword fails > 8fa4173 gopls/internal/server: conditionally prompt for telemetry > b9a361a gopls/internal/golang: provide version info for stdlib methods > dd9d554 go/ast/astutil: PathEnclosingInterval: add missing FuncType nodes > 3db1ddb gopls/internal/golang: provide available version info in stdlib hover > 008ed2c gopls/internal/golang/completion: fix package clause completion suffix > b297f5a gopls/internal/golang: s/return values/results/ > b5bfa9c gopls/internal/fuzzy: move the fuzzy package to gopls > 02912f7 gopls/internal/cache: lift package caching to forEachPackage > e7f294d gopls/matcher: don't give bonus to case insensitive match > 480a22d gopls/completion: don't take address of interfaces for "%p" values > 3151270 gopls/internal: add code action "extract declarations to new file" > 850c7c3 gopls: skip failing tests on wasm/wasip1 > dc34122 gopls/internal/golang: fix hovering from the builtin file > 1028e30 gopls/internal/settings: remove fieldalignment analyzer > 5fefc65 go/analysis/passes/stringintconv: do not generate empty edits > 1e6c1e2 gopls/internal/golang: strip @v1.2.3 suffix from pkgdoc URLs > 7de8d0a gopls/internal/analysis/simplifyrange: reenable on range-over-func > c9675c2 internal/refactor/inline: avoid unnecessary import renames > f06ed92 gopls/internal/settings: define InlayHints enum > 833def6 gopls/internal/settings: move CodeActionKind values from protocol > 47bd819 gopls/internal/server: fix CSS typo > df4e862 gopls/internal/settings: minor cleanups > 4a26477 internal/refactor/inline: allow duplicable type conversions > db513b0 go/ssa: wait for shared functions to finish building > 8a45e6c go/analysis/passes/asmdecl: define register-ABI result registers for loong64 > dfdfa49 go/types/objectpath: support Signature.RecvTypeParams > 2d104ec gopls/doc/generate: treat LinksInHover as an enum > b994346 gopls/doc/assets: create dummy submodule for image files > 18e694b gopls/doc/release: finalize v0.16.0 release notes > 99779e9 gopls/internal/settings: move CodeLensSource from protocol > 9bf0e21 gopls/internal/test/integration/misc: skip asm test unless a{rm,md}64 > f2d2ebe go/analysis/passes/buildtag: retire Go 1.15 support > 1239d04 gopls/internal/golang: Hover: use internal pkg doc viewer > 6ece8fb gopls/internal/golang: improve ergonomics of "Browse documentation" > 693d7fe gopls/internal/settings: simplify SetOptions > 977f6f7 go/packages: move getSizesForArgs back > 6a8bc5f gopls/internal/lsp/source: ignore lambdas in call hierarchy > b5dbe8b gopls/internal/golang: s/View/Browse/ for browser-based features > 2ca6abe gopls: expand on documentation about version support changes > b59dd37 go/analysis: document interpretation of multiple diagnostics > 4419f4f go/analysis/passes/stringintconv: offer fix of fmt.Sprint(x) > a69d9a2 internal/analysisinternal: AddImport helper for inserting imports > db99e8a gopls/internal/test/integration/misc: skip ASM assertions on risc64 > a852b25 gopls/doc/release: update gopls release notes for language support > 03d7125 gopls/doc/emacs.md: use more precise before-save terminology > e4b0a18 internal/checker: run despite all errors > f45db9b internal/protocol/command: regenerate commands to fix build > 568dea1 gopls: update x/telemetry dependency > 82912d2 internal/imports: fix starvation in external candidate search > 3e94830 internal/imports: optimize package path filtering > dddd55d go/ssa: fixing Named type substitution > 46928a5 gopls: fix StmtToInsertVarBefore for switch stmts > 318adf2 gopls/internal/protocol/command/gen: omit unnecessary MarshalArgs calls > bffeaaa gopls/internal/golang: s/Show/View/ for web-based reports > a9021a5 go/ssa: export Defer.DeferStack field > ae52477 cmd/deadcode: fix nil panic in Edge.Site.Pos > 82be0b4 gopls/internal/server: return a non-nil slice for empty token result > 413a491 gopls/internal/golang: factor the 3 web reports > f41a407 gopls/internal/golang: Web, an abstraction of server.web > f5a26d2 gopls/internal/server: simplify FreeSymbols plumbing > 0341917 gopls/internal/cache: stop module cache refresh on view shutdown > 8f4c6b0 gopls/internal/test/integration/misc: fix build > 15d13c3 gopls/internal/golang: add "Show assembly of f" code action > a35b054 gopls/internal/test/integration: style tweaks to CodeAction > fc82f4e gopls/internal/protocol/command: use gopls.foo form everywhere > c24ae10 gopls/internal/cmd: cleanup progress handling > 6e3b208 gopls/internal/test: add test case for parameter rename match import > 5e0f1d8 gopls/internal/server: fix regression in organize imports code action > 1c73966 internal/imports: add a warning not to remove the fixImports seam > d9366dd internal/imports: restore fixImports extension point > 8bf61b8 gopls/internal/cache: fix module resolver cache refreshing > 7522327 gopls/rename: Fix spurious package name conflicts. > 5e43887 internal/stdlib: generate from api/next/*.txt (go1.23) too bumping golang.org/x/mod c0bdc7b...d58be1c: > d58be1c sumdb/tlog: set the hash of the empty tree according to RFC 6962 > 232e49f Revert "module: add COM0 and LPT0 to badWindowsNames" bumping knative.dev/pkg 3f6a546...b4e5f07: > b4e5f07 Bump google.golang.org/grpc from 1.64.0 to 1.65.0 (# 3073) > fe204d0 Bump golang.org/x/net from 0.26.0 to 0.27.0 (# 3072) > 9dc5206 Bump golang.org/x/tools from 0.22.0 to 0.23.0 (# 3074) > 7ecd548 Update community files (# 3071) bumping golang.org/x/term 5f0bb72...c976cb1: > c976cb1 go.mod: update golang.org/x dependencies bumping knative.dev/hack 0914314...b979959: > b979959 Update community files (# 387) Signed-off-by: Knative Automation <automation@knative.team> |
||
---|---|---|
.. | ||
LICENSE.txt | ||
README.md | ||
testall.sh | ||
xxhash.go | ||
xxhash_amd64.s | ||
xxhash_arm64.s | ||
xxhash_asm.go | ||
xxhash_other.go | ||
xxhash_safe.go | ||
xxhash_unsafe.go |
README.md
xxhash
xxhash is a Go implementation of the 64-bit xxHash algorithm, XXH64. This is a high-quality hashing algorithm that is much faster than anything in the Go standard library.
This package provides a straightforward API:
func Sum64(b []byte) uint64
func Sum64String(s string) uint64
type Digest struct{ ... }
func New() *Digest
The Digest
type implements hash.Hash64. Its key methods are:
func (*Digest) Write([]byte) (int, error)
func (*Digest) WriteString(string) (int, error)
func (*Digest) Sum64() uint64
The package is written with optimized pure Go and also contains even faster
assembly implementations for amd64 and arm64. If desired, the purego
build tag
opts into using the Go code even on those architectures.
Compatibility
This package is in a module and the latest code is in version 2 of the module. You need a version of Go with at least "minimal module compatibility" to use github.com/cespare/xxhash/v2:
- 1.9.7+ for Go 1.9
- 1.10.3+ for Go 1.10
- Go 1.11 or later
I recommend using the latest release of Go.
Benchmarks
Here are some quick benchmarks comparing the pure-Go and assembly implementations of Sum64.
input size | purego | asm |
---|---|---|
4 B | 1.3 GB/s | 1.2 GB/s |
16 B | 2.9 GB/s | 3.5 GB/s |
100 B | 6.9 GB/s | 8.1 GB/s |
4 KB | 11.7 GB/s | 16.7 GB/s |
10 MB | 12.0 GB/s | 17.3 GB/s |
These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C CPU using the following commands under Go 1.19.2:
benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$')
benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$')