mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
5b869f3f34
Previously, the FFI overhead for Rust/serde was estimated at <1%. This commit adds proper measurement infrastructure and reveals the actual overhead is ~10%: - CString conversion: ~5.4% (memory copy of 82KB string) - FFI call mechanics: ~5.5% Changes: - Add measure_twitter_ffi_overhead() and measure_citm_ffi_overhead() functions in lib.rs that measure pure serde vs FFI overhead - Add FfiOverheadResult struct to serde_benchmark.h - Add measure_rust_ffi_overhead() in benchmark_serialization_twitter.cpp - Update benchmark_writeup.md with measured results and corrected claims Key findings: - Pure Rust serde_json: ~1,930 MB/s - With FFI overhead: ~1,730 MB/s (as reported) - simdjson vs pure Rust/serde: ~1.5x faster (not 2x) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>