Libero Transport Benchmarks
This directory contains a reproducible benchmark harness for comparing Libero’s default ETF transport with the generated JSON transport.
Run it from the repository root:
bash benchmarks/run.sh
The script creates a temporary Gleam project, points it at this checkout of Libero, generates Libero artifacts from explicit Rally-style seeds, then runs benchmark modules against the generated helpers. Results overwrite the current report and CSV files in this directory.
Current report:
The benchmark deliberately measures separate stages:
- server encode: benchmark response pre-encoder plus wire frame encoding
- server request decode: wire request decode plus generated
RequestMsgdecode - JS JSON parse only:
gleam/json.parsewithout generated typed rebuild - JS JSON wire decode:
libero/json/wire.decode_server_framewithout generated typed rebuild - JS JSON typed decode: generated typed payload rebuild from an already extracted response value
- JS response decode: wire frame decode plus generated typed payload rebuild
Payload coverage includes app-like shapes plus an explicit type_matrix payload
covering shared transport shapes: primitives, BitArray, lists, Option,
Result, tuples, zero-field variants, unlabelled constructors, nested custom
types, and Dict with String, Int, and Bool keys.
Do not compare a single row as “JSON vs ETF overall”. The report labels each row by stage because the useful signal is where each codec spends time.