Skip to main content

Posts

Showing posts with the label OTP 27

Benchmarking Erlang/OTP 27: Native JSON vs. Jiffy for High-Throughput Systems

  For over a decade, high-throughput Erlang and Elixir systems—specifically in AdTech and High-Frequency Trading (HFT)—have accepted a "NIF tax" for JSON processing. We rely on C-based libraries like   jiffy   (or Rust-based ones) because pure Erlang parsers were historically too slow for massive ingestion pipelines. However, NIFs (Native Implemented Functions) introduce stability risks (segfaults crash the VM), build complexity, and scheduler overhead. With the release of Erlang/OTP 27, we finally have a dedicated, native  json  module. The critical engineering question is no longer theoretical:  Is the new native implementation performant enough to remove C dependencies from our critical path? The Root Cause: The NIF Overhead vs. JIT To understand the benchmark, we must understand why  jiffy  was faster and why native code is catching up. The NIF Advantage (Historical):  Parsing text is CPU-intensive. C compilers optimize this aggressively ...