Problem
When string interning is enabled, the encoder/decoder dict (`map[string]int` / `[]string`) is lazily allocated and grows unbounded within a session. Map growth causes internal rehashing allocations. The decoder dict (`[]string`) appends per unique string, causing slice growth allocations.
Proposal
Options:
- Pre-allocate dict with a configurable initial capacity
- Pool the dict maps/slices via `sync.Pool` and `clear()` on return
- Reset and reuse between calls (already partially done in `PutDecoder`)
Files
- `intern.go` — encoder dict (line ~66), decoder dict (line ~230)
- `decode.go` — `PutDecoder()` dict cleanup
Expected Impact
LOW-MEDIUM — only affects workloads using string interning. Reduces dict-related allocations and rehashing overhead.
Problem
When string interning is enabled, the encoder/decoder dict (`map[string]int` / `[]string`) is lazily allocated and grows unbounded within a session. Map growth causes internal rehashing allocations. The decoder dict (`[]string`) appends per unique string, causing slice growth allocations.
Proposal
Options:
Files
Expected Impact
LOW-MEDIUM — only affects workloads using string interning. Reduces dict-related allocations and rehashing overhead.