$ show djkoloski/rust_serialization_benchmark
This repository is a comprehensive benchmarking suite for Rust serialization libraries. It compares over 20 serialization frameworks (e.g., bincode, capnp, flatbuffers, rkyv, prost, serde_json) across four synthetic datasets (log, mesh, minecraft_savedata, mk48) that model realistic data shapes. Benchmarks measure serialization/deserialization speed, payload size, compression (zlib, zstd), and zero-copy access. The codebase includes a deterministic data generation framework via the `Generate` trait, a tooling pipeline (bencher, parser, formatter) for running benchmarks and auto-updating the README with results, and an interactive Yew-based web page for visualizing throughput under bandwidth/CPU constraints. While primarily a research/benchmarking project, it also demonstrates high-quality patterns for conditional compilation, feature-gated code generation, and shared schema definitions across CLI and web frontend.
The LLM identified 5 files worth highlighting for reuse:
Defines the `Generate` trait and `generate_vec` function for creating deterministic, reproducible test data across all datasets. This pattern is reusable for any benchmark or test suite that needs controlled random data generation with configurable seeds and distributions.
Contains the `BorrowableData` trait with associated `Borrowed` type, enabling unified benchmarking of zero-copy decoding across libraries. This abstraction allows the benchmark harness to treat borrowed and owned decoding uniformly, and can be extracted for other multi-format serialization comparisons.
Orchestrates the full benchmark run: executes `cargo bench` with feature flags, captures output, invokes the parser and formatter, and commits updated results. This pipeline is reusable for any Rust benchmark suite that outputs criterion logs and wants automated result aggregation and README generation.
Defines the shared data structures (`Results`, `Dataset`, `Feature`, `Bench`, etc.) used by the bencher, parser, formatter, and web frontend. This avoids duplication and ensures consistency across the toolchain. The schema is a reusable pattern for any multi-tool project that needs a canonical representation of benchmark outcomes.
A Yew-based WASM web application that loads benchmark results and allows users to compute theoretical throughput (messages/second) given bandwidth, CPU, dataset, and mode. It demonstrates a clean separation of data loading, calculation, and rendering, and can serve as a template for building interactive data dashboards from structured JSON results.