Tags: buger/jsonparser
Tags
v1.6.1: gjson-style fast-skip optimization + benchmarks vs gjson/sonic Performance: - gjson >'\' fast-skip in stringEndConfig, blockEndConfig, searchKeysConfig - Medium: -19.4%, Small: -11.3%, Large: -3.2% (zero allocations maintained) Benchmarks: - Added gjson (tidwall/gjson) and sonic (bytedance/sonic) - jsonparser is now the fastest across ALL payload sizes - README updated with full comparison
v1.6.0: Append function + all KI fixes (zero open known issues)
New API:
- Append(data, value, keys...) — clean array-append without knowing
array length. Works on top-level and nested arrays. Auto-creates
missing paths as single-element arrays.
Bug fixes (all known issues resolved):
- KI-2: ParseInt('-') now returns MalformedValueError (was 0, nil)
- KI-3: disposition updated to 'fixed' (already fixed via auto-coerce)
- KI-4: Set on top-level array index now appends (was KeyPathNotFoundError)
Proof: 123 requirements, 0 errors, 0 warnings, 0 open known issues.
All 4 KIs now status: fixed.
Contributed by codex (gpt-5-codex) via codex exec.
v1.5.1: 6.1x large-payload speedup + fresh benchmarks Performance: - Fix stringEnd unbounded backslash scan (5.8x speedup) - SWAR string scan (additional 8%) - Total: 128us -> 21us on large payload Benchmarks: - Updated ALL comparison libraries to latest versions - Fixed ffjson measurement bug (encoding/json now measured correctly) - README benchmark tables refreshed with real data - Methodology documented (M4 Max, Go 1.26.3, median of 5 runs) README headline: 'up to 6x faster' (was '10x' — old number measured ffjson not encoding/json) CHANGELOG: v1.5.1 entry with performance table.
v1.4.0: ArrayEachErr, Escape/SetString, wildcards, JSONPath, GetArray… …Len, GetUint64, DeleteFound New APIs (all backward-compatible, additive only): Iteration with error/break control: - ArrayEachErr: callback returns error to stop iteration early (io.EOF = graceful stop) - EachKeyErr: same pattern for EachKey Resolves: #53, #129, #176, #230, #255, #262 Safe string handling: - Escape: RFC 8259 string escaping (inverse of Unescape) - SetString: Set with auto-quoted string value Resolves: #144, #158, #218, #270 Container accessors: - GetArrayLen: count array elements without callback - GetObjectLen: count object key-value pairs without callback - GetUint64: uint64 variant of GetInt Resolves: #175, #261, #271 Delete found signal: - DeleteFound: returns (result, found bool) Resolves: #229 Wildcard paths: - EachKeyWildcard, ArrayEachWildcard, SetWildcard: [*] path component Resolves: #112 JSONPath compiled paths: - ParsePath: $.a.b[0] → []string path - CompilePath + CompiledPath: pre-compile + Get/Set/Delete methods Resolves: #234, #251 Fixes: - EachKey no longer panics with >64 key components (#56) - Set pre-allocates output buffer reducing allocations 6→1 (#107) Proof coverage: - 3 new SYS-REQs (112 container length, 113 wildcard, 114 compiled paths) - 121 total requirements, 0 errors, 0 warnings - 384 MC/DC witness rows, 0 uncovered - LocalChange CHG-260728-RKTS records the feature release - All new functions traced via source-native annotations Contributed by codex (gpt-5-codex) via codex exec.
v1.3.1: fix Set aliasing (#209/#141), EachKey array-index (#232), ben… …chmark ffjson (#126) Bug fixes: - Set/Delete no longer mutate the caller's input buffer backing array (append into spare capacity). Fixes #209, #141. - EachKey now descends into terminal array-index paths consistently with Get. Fixes #232. - Benchmark payload types no longer have ffjson-generated methods; the encoding/json benchmark now measures the real stdlib. Fixes #126. Proof strengthening (closes the gaps that let these bugs escape): - New obligation: no_input_mutation (Set/Delete must not modify input beyond the returned slice) — catalog overlay + proof.yaml declaration - New obligation: api_consistency (EachKey path resolution == Get path resolution) — catalog overlay + proof.yaml declaration - assertInputUnchanged gate in property/oracle tests: snapshots input bytes + backing-array capacity before every Set/Delete, verifies unchanged after - TestApiConsistencyEachKeyMatchesGet gate: random JSON + paths, asserts EachKey result == Get result (the differential that would have caught #232) - Benchmark honesty lint: verifies no benchmark type implements json.Marshaler/Unmarshaler (would have caught #126) Contributed by codex (gpt-5-codex) via codex exec.
docs: add proof coverage to README + CHANGELOG for v1.3.0 README: prominent L3 assurance badge + proof-coverage section (118 reqs, 0/0 audit, 100% MC/DC, 250k fuzzer execs/sec) with link to reqproof.com. Positions jsonparser as the ReqProof reference case study. CHANGELOG.md: full v1.3.0 entry featuring the formal-verification work, 7 bug fixes, 2 performance improvements, contributor credits, and links to the json-fuzz package and root-cause analysis.
Merge pull request #221 from d-hat/CVE-2020-35381 Attempt to fix #219 and introduce a test. The only error that can easily be returned in this case is `KeyPathNotFoundError`, which is reasonable if you squint (a malformed key can not be found). Note I'm far from fluent in golang so this should be reviewed with some care 😄
PreviousNext