Technical Architecture

Lunyn's parsing engine represents a complete rethinking of market data processing architecture. Traditional approaches sacrifice either performance or maintainability. We engineered both.

Core Architecture

Zero-Copy Parsing Strategy

Parsing operations occur directly on ingested buffers without intermediate allocations. Message boundaries are identified through pointer arithmetic, and field access happens via calculated offsets.

Benchmark scope: memory-mapped historical data with per-message heap allocation avoided in the parser hot path.

Lock-Free Architecture

Multi-threaded processing using lock-free queues and wait-free data structures. Each parsing thread operates independently with minimal synchronization. Message distribution uses MPSC (multi-producer, single-consumer) queues for message routing, memory ordering guarantees for safe concurrent access, and per-thread state to eliminate cache contention.

Benchmark result: 8 vCPUs reached 1,419 M msg/s for framing and 499.7 M msg/s for full decode on the tested host.

Vectorized Operations

Critical parsing operations leverage AVX2 instruction sets to process multiple fields simultaneously: Parallel byte-to-integer conversion, vectorized field extraction, and SIMD-optimized timestamp parsing. Specific operations can process 8 message fields in parallel vs. sequential processing.

Implementation detail: direct binary field access reduces intermediate parsing work in supported message paths.

Production-Grade Reliability

Comprehensive error handling for malformed messages, out-of-sequence data, protocol violations, and edge cases. The parser reports detailed diagnostics for debugging.

System maintains parsing state across errors with detailed diagnostics.

Complete ITCH 5.0 Implementation

Message TypeFrequencyParse Latency (framing / full decode)Memory
System EventRare5.2 ns / 9.9 ns16B
Stock DirectoryDaily5.2 ns / 9.9 ns256B
Add OrderVery High5.2 ns / 9.9 ns64B
Add Order (MPID)High5.2 ns / 9.9 ns72B
Order ExecutedHigh5.2 ns / 9.9 ns48B
Order Executed (Price)Medium5.2 ns / 9.9 ns52B
Order CancelHigh5.2 ns / 9.9 ns40B
Order DeleteMedium5.2 ns / 9.9 ns32B
Order ReplaceHigh5.2 ns / 9.9 ns64B
Trade (Non-Cross)High5.2 ns / 9.9 ns56B
Cross TradeLow5.2 ns / 9.9 ns72B
Broken TradeRare5.2 ns / 9.9 ns40B
NOIIHigh5.2 ns / 9.9 ns128B
RPIIMedium5.2 ns / 9.9 ns48B

Validated Performance Metrics

Throughput vs. Core Count
1 thread, framing:213.7 M msg/s
1 thread, full decode:93.9 M msg/s
8 vCPUs, framing:1,419 M msg/s
8 vCPUs, full decode:499.7 M msg/s

Median results across 10 full-dataset runs

Measured Latency
Framing average:5.2 ns/message
Full decode average:9.9 ns/message
Maximum observed:22 µs
Measurement:1,000-message batches

Measured on the October 30, 2019 historical ITCH session

Benchmark Resources
Host memory:32 GB DDR5
Dataset size:9,035,016,843 bytes
Physical cores:4
Virtual CPUs:8

Google Cloud c3-standard-8 benchmark host

Benchmark Measurement
Dataset messages:293,989,079
Session date:October 30, 2019
Runs:10 full-dataset runs
Optimization:-C target-cpu=native

Median results; disk and network overhead excluded

All metrics reproducible via our benchmark suite. Contact us for evaluation access.

View Full Benchmark Report

Deployment Options

Binary Integration

Link directly into your application via provided API. Supports real-time streaming interfaces, batch file processing, and custom message routing.

Language bindings: C++, Rust, Python
Standalone Service

Deploy as microservice with gRPC or REST API, Kafka/Redis output streams, and monitoring and alerting integration.

Language bindings: Any (via API)
File Processing Pipeline

Command-line tool for batch conversion (ITCH → Parquet/CSV), historical data processing, and data quality validation.

Language bindings: CLI

Evaluate the Architecture

Request access to detailed technical documentation, benchmark methodologies, and integration guides for your evaluation.