采用更快的Hash算法

This commit is contained in:
GoEdgeLab
2020-11-21 22:29:57 +08:00
parent 5485a5f663
commit d77749b0cd
12 changed files with 40 additions and 35 deletions

View File

@@ -3,7 +3,7 @@ package grids
import (
"bytes"
"compress/gzip"
"github.com/dchest/siphash"
"github.com/cespare/xxhash"
"github.com/iwind/TeaGo/logs"
"sync/atomic"
"unsafe"
@@ -18,7 +18,7 @@ const (
)
func HashKey(key []byte) uint64 {
return siphash.Hash(0, 0, key)
return xxhash.Sum64(key)
}
type Item struct {