Skip to content

[bench] Parser micro-benches (Turtle, JSON-LD, SPARQL) #1234

Open

Description

@aaj3f

Status (checked on main at f42ea37, 2026-11-14)

The JSON-LD part is covered by fluree-db-api/benches/jsonld_parse.rs (894f03d), a parse-only JSON-LD transaction bench. The parse-only Turtle and SPARQL benches are still missing.


Original description

Context

Follow-up bench from PR #1228 review (coverage gap #8). Turtle, JSON-LD, and SPARQL parser hot paths are exercised through import_bulk and transact_commit end-to-end, but never isolated. A regression in any of these parsers would surface here only as a small percentage of query_hot_bsbm setup or import_bulk time, where it's easy to mistake for noise.

Scope

Add fluree-db-query/benches/parser_micro.rs (or split into three files if that's cleaner — parser_turtle.rs, parser_jsonld.rs, parser_sparql.rs):

  • Turtle parser: parse a gen::people-generated Turtle blob at Tiny/Small scales. Measure throughput in triples/sec (parse-only — no Fluree state).
  • JSON-LD parser: parse a gen::people JSON-LD @graph document. Same metric.
  • SPARQL parser: parse the BSBM Q3/Q5/Q9 strings from query_hot_bsbm.rs plus a few longer-shape queries (UNION + OPTIONAL + property paths). Measure throughput in queries/sec.

Each:

  • Use the chassis pattern. current_profile(), current_scale(), init_tracing_for_bench(). No tokio runtime needed for pure parsing — bench_runtime() is unnecessary here.
  • No Fluree state. This is parser-only, no need to build a Fluree.
  • Register budgets in regression-budget.json. Tighter budgets here are appropriate since parsing is deterministic and CPU-bound.

Acceptance

  • Bench(es) compile and run --test green at tiny.
  • regression-budget.json has entries.
  • BENCHMARKING.md's "Current benches" table grows one or three rows depending on the file split.
  • Bench-gate CI job picks them up.

References

Out of scope

This is parse-only. Round-trip serialization correctness is owned by existing tests; this bench isolates parser perf.

Activity

  1. added
    P2
    area:sparql
    on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:sparql

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions