Prediction-market engine

10.4 µs p50, 58.8k msg/s single-thread peak, 55× faster than JSON over HTTP

One message from the Python signal to the C++ engine, median trip. Press play to watch it race the old JSON path in slow motion.

View
  • Shared-memory engine · 10.4 µs
  • JSON over HTTP · 577 µs

Shared-memory engine: racing

JSON over HTTP: 0 µs so far

Slowed about 10,000× for viewing: the 577 µs trip takes about 5.8 seconds here. Times are the measured medians.

Single-thread peak: 58.8k msg/sno dropped writes

Measured once on one machine (Apple M2 Pro, idle). Numbers do not transfer.

How this works

A price gap appears between two prediction markets. The Python signal spots it and hands one message to the C++ engine through shared memory. The median trip takes 10.4 µs, and one thread sustains 58.8k messages a second with no dropped writes.

The race runs that trip against the pairing it replaced: JSON over HTTP, which takes 577 µs at 5,900 messages a second. That is the 55× in the headline (577 ÷ 10.4 ≈ 55).

Limits

  • Slowed about 10,000× so the eye can follow; spacing keeps the measured ratio.
  • Compare only the 5,900 msg/s row: at higher rates the control stops holding its target.
  • Measured once on one machine (Apple M2 Pro, idle, 30 s samples plus at least 1500 per cell, cold start discarded). Numbers do not transfer.

Numbers

  • 10.4 µs p50, Python to C++ (median at 5,900 msg/s and up).
  • 58.8k msg/s single-thread peak (58,758 exact), no dropped writes.
  • 55× faster than JSON over HTTP at 5,900 msg/s.