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
References
Out of scope
This is parse-only. Round-trip serialization correctness is owned by existing tests; this bench isolates parser perf.
Context
Follow-up bench from PR #1228 review (coverage gap #8). Turtle, JSON-LD, and SPARQL parser hot paths are exercised through
import_bulkandtransact_commitend-to-end, but never isolated. A regression in any of these parsers would surface here only as a small percentage ofquery_hot_bsbmsetup orimport_bulktime, 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):gen::people-generated Turtle blob atTiny/Smallscales. Measure throughput in triples/sec (parse-only — no Fluree state).gen::peopleJSON-LD@graphdocument. Same metric.query_hot_bsbm.rsplus a few longer-shape queries (UNION + OPTIONAL + property paths). Measure throughput in queries/sec.Each:
current_profile(),current_scale(),init_tracing_for_bench(). No tokio runtime needed for pure parsing —bench_runtime()is unnecessary here.Fluree.regression-budget.json. Tighter budgets here are appropriate since parsing is deterministic and CPU-bound.Acceptance
--testgreen attiny.regression-budget.jsonhas entries.BENCHMARKING.md's "Current benches" table grows one or three rows depending on the file split.References
fluree-graph-turtle,fluree-graph-json-ld,fluree-db-sparql/src/parse/.Out of scope
This is parse-only. Round-trip serialization correctness is owned by existing tests; this bench isolates parser perf.