Back to feed
Dev.to
Dev.to
7/1/2026
From Python/Pandas to Rust/C++: taking our tick simulation from 140ms to microseconds per window

From Python/Pandas to Rust/C++: taking our tick simulation from 140ms to microseconds per window

Short summary

An ML lab cut market-simulation latency from 900–1300ms to 1–5ms by migrating Python/Pandas to Rust + C++, using O(1) incremental state instead of rolling-window recomputation. The author shares honest trade-offs (cheap silicon, no colocation, zero look-ahead verified) and asks whether this approach could defend against adverse selection in production market-making.

  • 900–1300ms simulation latency reduced to 1–5ms by switching from Python/Pandas to Rust + C++.
  • Key win: O(1) incremental state per tick eliminated allocation churn and rolling-window recomputation.
  • Author seeks feedback from production HFT traders on whether this works for adverse-selection defense without colocation.

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more