You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(validation): decode serialized snapshots without reencoding #252
The default validation compiler marshals an input into a private JSON snapshot, then calls jsonValue(snapshot), which marshals those already serialized bytes again before exact-number decoding. A similar duplicate conversion exists for external schema registration. Large payloads pay for avoidable encoding and temporary buffers.
Proposed behavior
Decode already serialized, validated JSON bytes directly with the existing JSON v2 exact-number options. Reuse a small internal decoding helper at the known serialized call sites while retaining the original snapshot for diagnostic ordering. Ordinary Go/custom inputs still go through JSON v2 marshaling.
Alternatives considered
Skipping normalization or using float64 would change exact numeric validation and ownership. Global raw-JSON shortcuts could change errors for invalid/empty raw values. Keep the shortcut scoped to bytes already produced by the existing marshaler.
Scope accepted for implementation. Starting direct decoding only at already serialized snapshot boundaries, retaining exact-number and diagnostics behavior; coordinated with #250 and #251.
Implemented in #253. Exact numeric tokens, once-only marshaler failures, diagnostic snapshot ownership and the existing validation suite pass. Local large-string Validation decreases from 4.76 to 2.96 ms; complete packaged/consumer evidence is recorded. This issue remains open until the PR merges.
Activity
jinxiao commentedon Oct 15, 2026
Scope accepted for implementation. Starting direct decoding only at already serialized snapshot boundaries, retaining exact-number and diagnostics behavior; coordinated with #250 and #251.
jinxiao commentedon Oct 15, 2026
Implemented in #253. Exact numeric tokens, once-only marshaler failures, diagnostic snapshot ownership and the existing validation suite pass. Local large-string Validation decreases from 4.76 to 2.96 ms; complete packaged/consumer evidence is recorded. This issue remains open until the PR merges.