Repository navigation
jsonflat v0.2.0
Added
max_pooled_input: the largest input whose per-call state is kept for
reuse; the default is 4 MiB, as before. A kept state that has seen one
large document is now dropped after 64 consecutive inputs below an eighth
of that size, so one burst of large documents no longer pins memory for
good.- Tests and benchmarks behind the concurrency and memory claims:
TestSharedTransformerMixed(16 goroutines mixingAppend,Eachand
Optionson shared Transformers, under the race detector),
TestRetainedRecordIsInvalid,BenchmarkEachParallel,
BenchmarkVarsShared/BenchmarkVarsPerCall, and the report tests
TestColdPoolReport,TestBurstReport,TestMemoryReport,
TestKeySetReport.Example_lazyCompileshowssync.OnceValues. make profile: CPU, memory, mutex and block profiles of the hot
benchmarks, top 20 of each.
Changed
- Key lookups skip the hash when no entry has the key's length.
Appendis
16 % faster and the RudderStack preset 14 % faster on the benchmarks, still
at 0 allocs/op.
Fixed
- Docs: zero allocations is reached on the third call of a fresh pooled
state, not the first. The performance page now carries measured numbers
for scaling across CPUs, the cost of an empty pool, and the memory one
state holds, including the 8× ratio to the largest input.
Install
go get github.com/nayan9229/jsonflat@v0.2.0
API reference: https://pkg.go.dev/github.com/nayan9229/jsonflat@v0.2.0