MCPcopy
hub / github.com/klauspost/compress / bestFastEncoder

Struct bestFastEncoder

zstd/enc_best.go:69–75  ·  view source on GitHub ↗

bestFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches. The long match table contains the previous entry with the same hash, effectively making it a "chain" of length 2. When we find a long match we choose between the two values and select the longest. When we find a

Source from the content-addressed store, hash-verified

67// When we find a short match, after checking the long, we check if we can find a long at n+1
68// and that it is longer (lazy matching).
69type bestFastEncoder struct {
70 fastBase
71 table [bestShortTableSize]prevEntry
72 longTable [bestLongTableSize]prevEntry
73 dictTable []prevEntry
74 dictLongTable []prevEntry
75}
76
77// Encode improves compression...
78func (e *bestFastEncoder) Encode(blk *blockEnc, src []byte) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected