Sub-40ns zero-copy execution infrastructure built for quantitative trading and real-time systems.
Reported honestly as two distinct transport modes, not blended: overwrite mode maximizes producer speed and drops the oldest unread event once the ring saturates; backpressure mode guarantees zero loss at a throughput bounded by the attached consumer. Measured on a general-purpose Windows development host, not yet the CPU-isolated bare-metal reference topology — informative, best-effort figures pending reproduction on your own target hardware. See the Comparative Benchmark Table below, or the full Technical Benchmark Specification for reference hardware config and reproduction steps.
The concrete mechanisms behind the numbers above — every line item below maps to real code in this repository, not a marketing abstraction.
animus::sys::ipc::BroadcastRing<T> (lossy, one writer to many readers, the writer never waits) and animus::sys::ipc::SpscQueue<T> (lossless, one to one, strict backpressure) — C++17 core, built with a C++20-or-newer toolchain.alignas(64)) on x86-64 — auto-widens to 128 bytes on ARM64 targets with larger cache lines — to eliminate false sharing between the ring's producer-owned and consumer-owned cursors.std::memory_order_acquire / std::memory_order_release) on every cross-thread cursor handoff — no locks, no full fences.ctypes + memoryview — no serialization/deserialization step between the native ring and Python-side consumption.Attaching a consumer to an existing queue is a handful of lines in either language — no schema compiler, no broker, no connection handshake.
animus::sys::ipc::SharedMemoryRegion region;
animus::sys::ipc::SpscQueue<animus::ExecutionEvent> queue;
if (animus::sys::ipc::SharedMemoryRegion::open("animus_orders", region) &&
animus::sys::ipc::SpscQueue<animus::ExecutionEvent>::attach(region.data(), region.size(), queue)) {
animus::ExecutionEvent evt;
while (queue.try_pop(evt)) { /* handle evt, lossless */ }
}
engine = AnimusBindings()
engine.init(ring_capacity=4096)
signals = engine.poll_signals() # memoryview, zero-copy
Full API surface — CEP rule chaining, shared-memory IPC, market-data adapters — in the SDK Explorer below.
Animus figures are measured directly from this repository's own benchmark harness (saturation / overwrite mode — see hero disclosure above). Unix Domain Socket, TCP loopback, and Redis IPC figures are representative industry baselines for local IPC transports, not measurements of a specific third-party deployment on this hardware.
| Transport | Throughput | p50 | p99 | Zero-Copy |
|---|---|---|---|---|
| Animus Core IPC | 16.1M ops/s | 35.1 ns | 47.9 ns | Yes |
| Unix Domain Sockets | ~1.2M ops/s | 480 ns | 1,420 ns | No |
| TCP Loopback (127.0.0.1) | ~650k ops/s | 1,250 ns | 4,100 ns | No |
| Redis IPC | ~110k ops/s | 8,500 ns | 22,000 ns | No |
Animus's overwrite-mode figures measure raw producer-side enqueue speed under saturation, not a delivery guarantee — see the zero-loss backpressure-mode numbers in the hero above and Verified Native & Interop Benchmarks below.
Runs entirely on this device using high-resolution performance.now() timing and real ArrayBuffer memory transfers — measuring your own hardware's thread latency, throughput, and scheduling jitter live in your browser, not a server-side or third-party feed.
Client-side diagnostic using this browser's JS engine and memory subsystem as a proxy for scheduling behavior — not a substitute for the native Animus Engine benchmark harness.
Zero-overhead IPC bridging Python algorithmic strategy layers to bare-metal C++ execution cores.
CPU cache-line allocation (L1/L2/L3) feeding a zero-copy ring buffer pass-through into Python runtime memory, plotted against a traditional serialized IPC path. Shift concurrency and watch packet drops diverge.
Illustrative simulation of the architectural difference between kernel-mediated IPC and pointer pass-through, not a cycle-accurate profiler trace.
The C++ zero-copy lock-free core and the Python memoryview/ctypes consumer, side by side. One C-ABI surface, two runtimes, zero marshalling.
// animus_core.hpp — zero-copy, lock-free ring buffer core, cache-line aligned end to end
#pragma once
#include <cstdint>
#include <atomic>
#include <memory>
extern "C" {
struct alignas(64) RingSlot {
std::atomic<uint64_t> sequence;
uint8_t payload[256]; // fixed-size, no allocation
};
// Vyukov MPMC ring buffer — head/tail counters alignas(64) to avoid false sharing
class alignas(64) LockFreeRingBuffer {
public:
explicit LockFreeRingBuffer(uint32_t capacity)
: slots_(std::make_unique<RingSlot[]>(capacity)), capacity_(capacity) {}
bool push(const void* data, size_t len) noexcept;
bool pop(void* out, size_t max_len) noexcept;
private:
alignas(64) std::atomic<uint64_t> head_{0};
alignas(64) std::atomic<uint64_t> tail_{0};
std::unique_ptr<RingSlot[]> slots_;
uint32_t capacity_;
};
// Direct C-ABI export — no RPC framework, no schema compiler
__declspec(dllexport) void* animus_create(uint32_t ring_capacity);
__declspec(dllexport) bool animus_record_batch(void* engine, const uint8_t* buf, size_t len);
__declspec(dllexport) size_t animus_poll_signals(void* engine, uint8_t* out, size_t max_len);
} // extern "C"
# animus_wrapper.py — zero-dependency, ctypes + memoryview, microsecond zero-copy interop
import ctypes
import time
from ctypes import c_void_p, c_uint32, c_size_t, c_uint8, c_bool, POINTER
class AnimusEngine:
def __init__(self, lib_path="animus_core.dll"):
self.lib = ctypes.CDLL(lib_path)
self.lib.animus_poll_signals.restype = c_size_t
# Buffer allocated once; memoryview gives a zero-copy window onto it
self._out = (c_uint8 * 65536)()
self._view = memoryview(self._out).cast('B')
self.handle = None
def init(self, ring_capacity=4096):
self.handle = self.lib.animus_create(c_uint32(ring_capacity))
# One raw byte buffer per batch, not one marshalled object per event
def record_events_batch(self, buf: bytes) -> bool:
arr = (c_uint8 * len(buf)).from_buffer_copy(buf)
return self.lib.animus_record_batch(self.handle, arr, c_size_t(len(buf)))
# memoryview over the same ctypes buffer — zero-copy read, no (de)serialization
def poll_signals(self) -> memoryview:
t0 = time.perf_counter()
n = self.lib.animus_poll_signals(self.handle, self._out, c_size_t(len(self._out)))
elapsed_us = (time.perf_counter() - t0) * 1e6 # microsecond payload consumption, no IPC hop
return self._view[:n] # consumer reads directly off native memory
Tail latency comparison across gRPC, Unix Domain Sockets, and the Animus Zero-Copy Core. Toggle a series to isolate its distribution curve. Animus figures are the same C++23 cross-core SPSC measurement in the Verified Native & Interop Benchmarks section below; gRPC/UDS figures are representative industry baselines, not measurements of a specific third-party deployment.
| Transport | p50 | p90 | p99 | p99.9 |
|---|
Cross-core producer/consumer transport (C++23, RDTSC-resolution) and the Python zero-copy interop layer built directly on it — measured, not modeled. Both harnesses ship in this codebase and are reproducible from source.
Genuine cross-core producer→consumer handoff through a lock-free SPSC ring — one producer thread and one consumer thread pinned to separate physical cores, timestamped with lfence-serialized RDTSC reads calibrated against std::chrono::steady_clock, not assumed from the advertised clock speed.
A background native producer thread hands events to Python through a real memoryview aliasing the ring's own memory — no per-event object construction, no heap allocation, no numpy dependency required. "Full decode" is the realistic cost once every event is actually materialized as a Python object — measured via benchmarks/python_interop_latency.py, 5 consecutive runs (25.4–27.3ns drain / 537.4–542.8ns full decode).
Architectural comparison, not a specific third-party vendor benchmark — the last row is what this repo's own harnesses actually measured on real hardware.
| Dimension | Traditional Message Sockets | Animus Zero-Copy Shared Memory |
|---|---|---|
| Transport | Kernel-mediated socket / message queue | Direct pointer pass-through, lock-free ring |
| Serialization | Marshal / unmarshal every message | None — identical struct layout on both sides |
| Copies per hop | 2–4 (userspace → kernel → userspace) | 1 (producer write → consumer read) |
| Kernel involvement | Every message crosses a syscall boundary | None on the steady-state hot path |
| Backpressure behavior | Buffer fills; kernel drops or blocks silently | Ring reports full explicitly — caller decides, nothing silently lost |
| Measured p50 (this repo) | 45–620µs (UDS–gRPC, representative baselines) | 53.3ns (RDTSC-measured) |
Source: the C++23 telemetry benchmark harness (RDTSC-resolution, cross-core SPSC) and the nanobind Python interop layer built directly on top of it — both shipped in this codebase, both reproducible from source, not vendor claims.
A separate transport axis from the SPSC ring above: Animus's lock-free multi-producer/multi-consumer ring under real 8-producer/8-consumer contention, verified over a multi-hour continuous soak run. Full methodology: Technical Whitepaper §3–4 · raw chronology: Soak Audit Report.
8 producer + 8 consumer threads running simultaneously (not sequential phases), sampled every 10s over a 40-second window: 7.26M–7.29M pushes/sec, correctness exact (290,993,953 produced = consumed). Single test session — a strong first sustained data point, not yet fully cross-validated across machines.
8 producer threads, ring pre-sized so nothing drains during the ~100–200ms timed window — producer-side enqueue speed in isolation, not a single-producer figure and not a sustained/production throughput citation. Traced to the short window sometimes catching a transient CPU turbo-boost (PL2) state. Use the 7.28M/s sustained figure to the left for real producer+consumer load.
51,623,591,903 events produced = 51,623,591,903 consumed, exact, zero deficit at completion. Compiled with -fsanitize=address -fsanitize=undefined and ran to completion with no ASan/UBSan abort — a sanitizer build terminates immediately on a detected violation, so a clean run to completion is the sanitizer's own attestation that none occurred. The 5.16–5.33M/s floor reflects sanitizer shadow-memory overhead, not the ~7.28M/s clean-build sustained figure above — see the whitepaper for the full reconciliation.
Test hardware: Intel Core i7-14650HX — 16 cores / 24 logical threads (8 Performance-cores w/ Hyper-Threading + 8 Efficiency-cores, confirmed by per-core isolation probe), 64-byte cache-line isolation (alignas(64)) on producer/consumer cursors. Source: AnimusCore_v1/BENCHMARKS.md, SOAK_TEST_AUDIT_REPORT.html.
Direct buffer pointers and low-latency shared-memory interop replace IPC marshalling on the hot path.
Direct extern "C" exports from a native .dll / .so — no RPC framework overhead on the wire.
Python 3.8+ interop via ctypes only — no third-party packages in the critical path.
Every exported function is complete, fully typed, and memory-safe — RAII-managed native lifetime end to end.
Issued strictly under institutional evaluation agreements for qualified quantitative trading desks and fintech infrastructure teams.
Institutional evaluation for qualified trading desks and fintech infrastructure teams.
Pilot_Kit\get_fingerprint.ps1 on the target machine and paste the printed 64-hex fingerprint below, or leave it blank and we'll send you the instructions. Prefer email? Send it directly to
inquiries@animusinfra.com.