Format parse comparison #
This non-gating harness compares the JSON, INI, and TOML integrations using the
same 21 string values grouped into five logical sections. It measures in-memory
parse, conversion to a config.Document, and destruction of every owner. File
I/O is intentionally excluded.
Run it from the odin_config repository with the pinned Reference Odin compiler:
odin run benchmarks -o:speed -vet -vet-style -warnings-as-errors -collection:external=external
The driver performs one warmup followed by seven batches of 50,000 operations
per format. In addition to the complete-operation comparison, it attributes the
TOML path across semantic parsing, conversion into config.Document, TOML DOM
destruction, and config destruction. The conversion phase includes
config.New and candidate commit but excludes destruction. Each phase otherwise
times only its named operation; required setup and cleanup run outside that
phase's accumulated duration. Timer reads are therefore included in every phase
operation, and the sum is an approximation rather than an identity with the
batched end-to-end result.
The conversion phase mirrors the current config_toml conversion in benchmark
code so it can reuse one parsed document. The end-to-end config_toml.Parse
measurement remains authoritative if the adapter changes. The harness reports
allocator requests for complete operations and separately for TOML semantic
parse and config conversion. Requested-byte totals reflect each integration's
arena strategy and are not peak-live-byte measurements.
The JSON and TOML encodings contain the same logical keys and string values but are not byte-identical: the JSON fixture is 509 bytes and the TOML fixture is 478 bytes. INI is retained as useful local context, not as a semantically identical format comparison.