Documentation
¶
Overview ¶
Package tuplefast is a zero-allocation FDB tuple decoder, shared by the record layer and the vector index package.
The standard FDB Go tuple.Unpack allocates bytes.NewBuffer + binary.Read per integer element (~3 heap objects per int). This decoder uses binary.BigEndian.Uint64 on stack arrays instead. Wire-format compatible with the canonical FDB tuple layer.
Index ¶
- Constants
- func DecodeBytes(b []byte) ([]byte, int, error)
- func NestedPKSpans(content []byte) ([][]byte, error)
- func Skip(b []byte) int
- func SplitKeySuffix(tupleBytes []byte) (suffix int64, pkEnd int, err error)
- func SubspaceUnpack(key []byte, prefixLen int) (tuple.Tuple, error)
- func Unpack(b []byte) (tuple.Tuple, error)
Constants ¶
const (
TypeCodeNested = 0x05
)
FDB tuple type codes.
Variables ¶
This section is empty.
Functions ¶
func NestedPKSpans ¶
NestedPKSpans splits the content of a neighbor-list tuple (the bytes between the 0x05 marker and its terminating 0x00) into one byte-span per element, WITHOUT decoding/boxing the elements. Children are stored verbatim, so each returned span is exactly the bytes Tuple{pk}.Pack() produces — which is both the fetch-key suffix (after the per-layer prefix) and a stable visited-set key. Spans are sub-slices of content.
func SplitKeySuffix ¶
SplitKeySuffix splits a tuple-encoded key into PK portion and trailing int64 suffix. Zero allocation.
func SubspaceUnpack ¶
SubspaceUnpack strips the subspace prefix and decodes the remainder using Unpack. Drop-in replacement for subspace.Unpack() with zero-alloc integer decode. Returns error if key is shorter than prefix.
Types ¶
This section is empty.