Skip to content

JSONL inspection validation policy: per-line json.loads costs 5.5x at 100 MB #89

Description

@valiantone

Summary

Decide the JSONL inspection validation policy: _stream currently pays json.loads on every line, which dominates inspection cost.

Measured impact (spike #48, PR #84, B2)

At 100 MB: full per-line validation = 1,740 ms median; scan-only = 319 ms (~5.5x). Validation is the cost, not scanning. A C scanner clears 3.55x, but the spike's conclusion (#48) is no native helper yet — the pure-Python policy change captures most of the win.

Options (semantics decision needed)

  1. Validate only the sampled lines (first sample_size) — cheap, weaker guarantees.
  2. Make full validation opt-in via an inspect parameter / API flag — default changes semantics.
  3. Keep full validation for small files, cap by bytes for large files.

Acceptance criteria

  • Policy decided and documented (affects FileInspection.unsupported_reason / row_count guarantees and API/MCP/CLI consumers).
  • Inspector behavior change covered by tests; default path performance measured against bench/native_spike/results.json baseline.

Context

Spike recommendation follow-up #4: bench/native_spike/README.md. Related: #48, #53 (closed — original inspector ticket).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:storageStorage adapter abstraction + filesystem adaptersenhancementNew feature or requestpriority:p2Do after evidence or dependency gates; optional portability capabilityv0.2.NEXTCommitted for a future 0.2.x release; not yet pinned to 0.2.4/0.2.5v0.2.xHotMem post-v0.2 follow-up work

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions