1- package compressjson
1+ package lib
22
33import (
44 "github.com/klauspost/compress/zstd"
@@ -18,13 +18,13 @@ var (
1818
1919// ZSTDTranscoder provides zero-allocation, high-throughput Zstandard compression and decompression
2020// by reusing globally pre-configured encoder and decoder instances.
21- // It has no internal state — all heavy lifting is done by the shared, thread-safe global objects.
21+ // It has no internal state - all heavy lifting is done by the shared, thread-safe global objects.
2222// This design eliminates per-instance initialization overhead and maximizes performance
2323// in hot paths (caching, messaging, logging, etc.) while remaining safe for concurrent use.
2424type ZSTDTranscoder struct {}
2525
2626// NewZSTDTranscoder returns a lightweight transcoder instance that operates on the global
27- // pre-initialized encoder and decoder. No allocation or setup is performed — the instance
27+ // pre-initialized encoder and decoder. No allocation or setup is performed - the instance
2828// is immediately ready for use and can be safely shared across the entire application.
2929func NewZSTDTranscoder () * ZSTDTranscoder {
3030 return & ZSTDTranscoder {}
@@ -33,7 +33,7 @@ func NewZSTDTranscoder() *ZSTDTranscoder {
3333// Compress compresses the input data in a single fast operation using the shared global encoder.
3434// It uses EncodeAll which is optimized for complete in-memory buffers and produces
3535// a fully framed, independently decompression output.
36- // The result is allocated once and returned — no internal buffers are reused.
36+ // The result is allocated once and returned - no internal buffers are reused.
3737func (t * ZSTDTranscoder ) Compress (src []byte ) ([]byte , error ) {
3838 // EncodeAll appends to the provided dest buffer; we pass a zero-length slice with capacity
3939 // to avoid extra allocations while still getting a fresh result slice.
0 commit comments