Deterministic Simulation Testing in Rust: A State Machine Approach

2025-08-05
Deterministic Simulation Testing in Rust: A State Machine Approach

The Polar Signals team shares their experience building a new Rust database with a state machine architecture that puts deterministic simulation testing (DST) front and center. Unlike their previous Go database, FrostDB, the new database eschews controlling the existing scheduler and instead uses a state machine model where all core components are written as single-threaded state machines communicating via a message bus. This approach provides complete control over concurrency, time, randomness, and failure injection, greatly simplifying DST implementation and uncovering two critical bugs. While this approach demands extra cognitive overhead, it results in more precise reasoning about system behavior and more reliable code.

Read more

Serverless API S2 Achieves Significant Performance Gains and Cost Savings with Continuous Profiling

2025-02-14
Serverless API S2 Achieves Significant Performance Gains and Cost Savings with Continuous Profiling

S2, a serverless API for streaming data, significantly improved performance and reduced costs by leveraging Polar Signals Cloud for continuous profiling. Facing challenges with inefficient CPU usage, limiting user capacity and increasing operational costs, S2 used Polar Signals Cloud's continuous profiling capabilities, particularly its pprof.me and inverted call stack features, to identify and resolve multiple performance bottlenecks. For example, a single line code change enabling hardware acceleration on Graviton via the sha2 library reduced CPU usage for SHA256 checksum computation from 68.37% to 31.82%, effectively doubling throughput. Further optimizations included improvements to AWS S3 Rust SDK CRC32C checksum computation and memory allocation. Polar Signals Cloud's flexible pricing also proved crucial for S2's unique needs.

Read more
Development continuous profiling