Benchmarks
Two different pieces of software are measured on this page, and they are kept apart because a figure for one says nothing about the other. Connection is the standalone client library that carries market data in and orders out. Engine is the engine itself running a strategy over a series.
Connection
Where the work is dispatching messages, this library leads. On bulk plaintext it moves 2.1 times the throughput of boost::beast over HTTP and 1.2 times over WebSocket, measured on the same machine against the same peer.
Work Contracts
The concurrency underneath is not a thread pool with a queue. It is Work Contracts — a lock-free, wait-free task-distribution structure built for low-latency C++, which is what keeps the dispatch path from degrading under contention. The library links it as a third-party component; the design was presented at CppCon 2024.
Work Contracts — Rethinking Task Based Concurrency & Parallelism for Low Latency C++, CppCon 2024
Michael Maniscalco; the component is buildingcpp/work_contract, MIT, listed on our third-party licences page.
Bulk throughput against boost::beast
MiB/s, higher is better
- solo76 Engine
- boost::beast
Our figure is the better of the two shipped C surfaces (export-C, export-C++); the boost figure is a synchronous Beast client over OpenSSL. Bars are rounded to whole MiB/s — the exact cells, to two decimals, are in the tables below. These four workloads are the load-stable ones: the small-payload and UDP cells swing by up to a factor of two between runs and are not a basis for any claim.
Two of those four bars go the other way, and the reason is worth stating rather than burying: on bulk TLS, boost leads — 3.5 times on HTTPS and 2.8 times on WSS. That gap is the bulk cipher, not the transport. Our mbedTLS AES-256-GCM path runs at a hardware-AES ceiling several-fold below OpenSSL's bulk GCM, which is a property of the crypto backend and shows up identically in the two Python rows that also go through OpenSSL. The message path above it is the part these benchmarks are about.
How these numbers were measured, and what they are not
Feeding a live robot is the job of a separate, standalone shared library, libtse_connection, with its own C surface and its own ABI version. It is a deliberately small client stack: one handle, one message type and six protocols — http, https, ws, wss, udp and udp_multicast. What follows is a full request-and-reply round trip through that library, measured against the kernel's own loopback ceiling and against four external stacks: boost::beast, Python requests, websocket-client and the Python standard-library socket.
Reference machine: 8-core Apple Silicon, 127.0.0.1 loopback, one process. Slice: threads=1, keepAlive=1 for TCP and 0 for UDP, receiveMode=park, best-of-3 at a 1-minute load of 1.09.
How to read the tables
- Share(thrpt) is throughput divided by the ceiling throughput for that payload; Share(lat) is the ceiling latency for that payload divided by the measured round trip. Both are fractions of the kernel floor, higher is closer to the ceiling, and this is the headline metric — not the absolute MiB/s.
- latency RT is the measured round-trip mean. server_cost is the peer's own self-instrumented per-op time. lat w/o server is the first minus the second.
- throughput is the measured rate in MiB/s, base-1024. exp. thrpt w/o server is payload divided by lat w/o server: a single request in flight, no pipelining.
- raw drives the connection core directly, export-C is the shipped C ABI, export-C++ is the C++ facade over it, export-Python is the Python module over the shared library. raw, export-C and export-C++ drive the same in-process echo peer, so they differ only by the marshalling layer.
- boost, py-requests, py-websocket-client and py-socket(stdlib) are external stacks included for context; they are not part of the library. boost runs its own in-process Beast peer. The three Python clients drive the same pure-Python echo peer as export-Python, so those four rows differ only by the client stack.
- Unit convention: 1 GiB/s = 8 × 2^30 / 10^9 ≈ 8.59 Gbit/s. Do not read a GiB/s figure as Gbit/s.
What these numbers are not
- Everything here runs over the 127.0.0.1 loopback inside one process. There is no NIC and no physical link. Loopback throughput is bounded by memcpy, socket buffers and scheduling, not by any line rate, so a GiB/s figure on this page is not a Gbit/s network figure and a 10GbE expectation does not apply.
- Because there is no line rate to measure against, the right question is what fraction of the kernel loopback ceiling each layer reaches. That is the Share of ceiling column, and it is the number to read first.
- 1 MiB throughput over HTTP is load- and peer-scheduling sensitive: the round trip includes the peer's own two 1 MiB string copies, whose wall time swings with scheduling. Read it as an order of magnitude, not a measurement. The load-stable signals in this epoch are bulk TLS (HTTPS at 1 MiB, identical to the previous baseline at 157 MiB/s), WS and WSS at 128 KiB, and the small-payload cells.
- server_cost is the peer's own self-instrumented per-op time, from request fully received to response send starting. It deliberately excludes transport, TLS encryption and the HTTP or WebSocket handshake — which is why HTTPS server_cost is close to HTTP, and UDP server_cost is close to zero.
- The ceiling probe is one-way, a 1-byte trigger answered by an N-byte reply, while every other row is a round trip. Share(lat) is therefore a fraction-of-floor indicator, not a ratio of two identical operations.
- Third-party versions measured: requests 2.34.2, websocket-client 1.9.0, and the standard-library socket module. boost is boost::beast plus boost::asio over OpenSSL, a synchronous Beast client, running against its own in-process Beast peer.
- Python WS and WSS at 128 KiB do not appear at all: the report omits them as peer-limited rather than reporting a number that measures the peer.
Every measured cell, all five payloads
Loopback baseline — kernel ceiling, no library
The kernel floor with no library in the path: a one-way 1-byte-trigger to N-byte-reply probe over 127.0.0.1. Every Share(thrpt) and Share(lat) figure in the tables below is a fraction of this row for the same payload.
| Payload | ceiling latency µs | ceiling throughput GiB/s | ceiling throughput Gbit/s |
|---|---|---|---|
| 64 | 15.42 | 0.00 | 0.03 |
| 1024 | 15.65 | 0.06 | 0.52 |
| 4096 | 15.70 | 0.24 | 2.09 |
| 65536 | 22.39 | 2.73 | 23.41 |
| 131072 | 29.20 | 4.18 | 35.91 |
| 262144 | 41.32 | 5.91 | 50.76 |
| 1048576 | 91.31 | 10.70 | 91.87 |
| 4194304 | 385.27 | 10.24 | 87.93 |
Payload 64 B
A full round trip at 64 B for every protocol and every implementation. The report reads the small-payload cells as part of the stable signal for this epoch.
| Protocol | Impl | latency RT µs | server_cost µs | lat w/o server µs | throughput MiB/s | exp. thrpt w/o server MiB/s | Share(thrpt) | Share(lat) |
|---|---|---|---|---|---|---|---|---|
| HTTP | raw | 68.7 | 0.70 | 68.0 | 0.89 | 0.9 | 22% | 22% |
| HTTP | export-C | 65.3 | 0.26 | 65.0 | 0.93 | 0.9 | 23% | 24% |
| HTTP | export-C++ | 64.4 | 0.40 | 64.0 | 0.95 | 1.0 | 24% | 24% |
| HTTP | export-Python | 89.6 | 0.64 | 88.9 | 0.68 | 0.7 | 17% | 17% |
| HTTP | boost | 46.4 | 0.20 | 46.2 | 1.31 | 1.3 | 33% | 33% |
| HTTP | py-requests | 408.0 | 0.67 | 407.3 | 0.15 | 0.1 | 3.8% | 3.8% |
| HTTPS | raw | 46.0 | 0.30 | 45.7 | 1.33 | 1.3 | 34% | 34% |
| HTTPS | export-C | 62.8 | 0.28 | 62.5 | 0.97 | 1.0 | 25% | 25% |
| HTTPS | export-C++ | 67.4 | 0.26 | 67.1 | 0.91 | 0.9 | 23% | 23% |
| HTTPS | export-Python | 94.0 | 0.51 | 93.5 | 0.65 | 0.7 | 16% | 16% |
| HTTPS | boost | 49.9 | 0.18 | 49.7 | 1.22 | 1.2 | 31% | 31% |
| HTTPS | py-requests | 451.6 | 0.68 | 450.9 | 0.14 | 0.1 | 3.5% | 3.4% |
| WS | raw | 43.1 | 0.14 | 43.0 | 1.42 | 1.4 | 36% | 36% |
| WS | export-C | 40.7 | 0.20 | 40.5 | 1.50 | 1.5 | 38% | 38% |
| WS | export-C++ | 41.1 | 0.28 | 40.8 | 1.49 | 1.5 | 38% | 38% |
| WS | export-Python | 120.5 | 0.48 | 120.0 | 0.51 | 0.5 | 13% | 13% |
| WS | boost | 81.6 | 0.00 | 81.6 | 0.75 | 0.7 | 19% | 19% |
| WS | py-websocket-client | 78.3 | 0.46 | 77.9 | 0.78 | 0.8 | 20% | 20% |
| WSS | raw | 46.2 | 0.18 | 46.0 | 1.32 | 1.3 | 33% | 33% |
| WSS | export-C | 44.6 | 0.16 | 44.4 | 1.37 | 1.4 | 35% | 35% |
| WSS | export-C++ | 45.3 | 0.16 | 45.1 | 1.35 | 1.4 | 34% | 34% |
| WSS | export-Python | 128.4 | 0.47 | 128.0 | 0.48 | 0.5 | 12% | 12% |
| WSS | boost | 87.0 | 0.04 | 87.0 | 0.70 | 0.7 | 18% | 18% |
| WSS | py-websocket-client | 103.3 | 0.62 | 102.7 | 0.59 | 0.6 | 15% | 15% |
| UDP | raw | 23.8 | 0.02 | 23.8 | 2.56 | 2.6 | 65% | 65% |
| UDP | export-C | 27.9 | 0.02 | 27.9 | 2.19 | 2.2 | 55% | 55% |
| UDP | export-C++ | 30.0 | 0.00 | 30.0 | 2.03 | 2.0 | 51% | 51% |
| UDP | export-Python | 92.5 | 0.08 | 92.4 | 0.66 | 0.7 | 17% | 17% |
| UDP | boost | 15.6 | 0.00 | 15.6 | 3.92 | 3.9 | 99% | 99% |
| UDP | py-socket(stdlib) | 101.8 | 0.14 | 101.7 | 0.60 | 0.6 | 15% | 15% |
Payload 1024 B
The source table carries UDP only at this payload, so UDP only is published here. Rows absent from the report are absent from this page.
| Protocol | Impl | latency RT µs | server_cost µs | lat w/o server µs | throughput MiB/s | exp. thrpt w/o server MiB/s | Share(thrpt) | Share(lat) |
|---|---|---|---|---|---|---|---|---|
| UDP | raw | 27.6 | 0.02 | 27.6 | 35.40 | 35.4 | 57% | 57% |
| UDP | export-C | 28.7 | 0.00 | 28.7 | 34.03 | 34.0 | 55% | 55% |
| UDP | export-C++ | 28.6 | 0.02 | 28.6 | 34.15 | 34.2 | 55% | 55% |
| UDP | export-Python | 93.1 | 0.07 | 93.0 | 10.49 | 10.5 | 17% | 17% |
| UDP | boost | 15.6 | 0.00 | 15.6 | 62.44 | 62.4 | 100% | 100% |
| UDP | py-socket(stdlib) | 145.7 | 0.21 | 145.5 | 6.70 | 6.7 | 11% | 11% |
Payload 131072 B
128 KiB, one of the load-stable signals. The Python WS and WSS rows are omitted by the report itself because they are peer-limited: the pure-Python echo peer's transport dominates at this size, so those runs measure the peer rather than the client and are not comparable to the C-peer and boost-peer rows.
| Protocol | Impl | latency RT µs | server_cost µs | lat w/o server µs | throughput MiB/s | exp. thrpt w/o server MiB/s | Share(thrpt) | Share(lat) |
|---|---|---|---|---|---|---|---|---|
| WS | raw | 282.0 | 4.65 | 277.3 | 443.34 | 450.8 | 10% | 10% |
| WS | export-C | 241.3 | 6.95 | 234.4 | 517.92 | 533.3 | 12% | 12% |
| WS | export-C++ | 230.6 | 4.15 | 226.5 | 541.96 | 551.9 | 13% | 13% |
| WS | boost | 273.4 | 0.05 | 273.3 | 457.21 | 457.3 | 11% | 11% |
| WSS | raw | 1062.1 | 4.20 | 1057.9 | 117.69 | 118.2 | 2.7% | 2.7% |
| WSS | export-C | 1024.3 | 4.20 | 1020.1 | 122.03 | 122.5 | 2.9% | 2.9% |
| WSS | export-C++ | 1009.2 | 3.65 | 1005.6 | 123.86 | 124.3 | 2.9% | 2.9% |
| WSS | boost | 356.6 | 0.00 | 356.6 | 350.53 | 350.5 | 8.2% | 8.2% |
Payload 1048576 B
1 MiB. The HTTP rows are the least precise cells on this page: the round trip includes the peer's own two 1 MiB string copies, whose wall time swings with machine load and scheduling, so a cross-report comparison of them reads as a regression that is not there. The HTTPS rows, by contrast, are load-stable and reproduced the previous baseline exactly at 157 MiB/s.
| Protocol | Impl | latency RT µs | server_cost µs | lat w/o server µs | throughput MiB/s | exp. thrpt w/o server MiB/s | Share(thrpt) | Share(lat) |
|---|---|---|---|---|---|---|---|---|
| HTTP | raw | 925.3 | 296.25 | 629.1 | 1080.73 | 1589.7 | 9.9% | 9.9% |
| HTTP | export-C | 1082.3 | 203.60 | 878.7 | 923.92 | 1138.0 | 8.4% | 8.4% |
| HTTP | export-C++ | 1231.7 | 208.90 | 1022.8 | 811.90 | 977.7 | 7.4% | 7.4% |
| HTTP | export-Python | 1253.8 | 65.03 | 1188.8 | 797.56 | 841.2 | 7.3% | 7.3% |
| HTTP | boost | 2274.5 | 0.50 | 2274.0 | 439.67 | 439.8 | 4.0% | 4.0% |
| HTTP | py-requests | 1683.2 | 44.60 | 1638.6 | 594.10 | 610.3 | 5.4% | 5.4% |
| HTTPS | raw | 6402.0 | 78.65 | 6323.4 | 156.20 | 158.1 | 1.4% | 1.4% |
| HTTPS | export-C | 6372.2 | 57.45 | 6314.8 | 156.93 | 158.4 | 1.4% | 1.4% |
| HTTPS | export-C++ | 6388.7 | 66.90 | 6321.8 | 156.53 | 158.2 | 1.4% | 1.4% |
| HTTPS | export-Python | 3744.4 | 53.72 | 3690.7 | 267.06 | 271.0 | 2.4% | 2.4% |
| HTTPS | boost | 1833.3 | 0.40 | 1832.9 | 545.46 | 545.6 | 5.0% | 5.0% |
| HTTPS | py-requests | 3173.4 | 53.84 | 3119.5 | 315.12 | 320.6 | 2.9% | 2.9% |
Source: connection — re-measure and regression analysis, 2026-08-08, section Q2 (redone measurement), best-of-3 at a 1-minute load of 1.09. Column definitions and caveats: the connection benchmark methodology document.
Engine
On the same machine and the same 320 591-bar minute series, a MACD robot completes a pass 1.2 times faster on this engine from C++ than on LEAN from C#, and 1.5 times faster from Python than LEAN from Python. The figures compare the pass itself: process start, the loading of the licensed library on this side and the start of .NET with its JIT on LEAN's, is deliberately left out of the comparison.
Seconds per pass against LEAN
seconds per pass over 320 591 minute bars, lower is better
- solo76 Engine
- LEAN
Each bar is the pass itself, from the first line of main to the summary read back; process start is excluded. Each figure is the best of three runs of three passes, on both sides alike. Bars are rounded to two decimals — the exact cells, to three, are in the tables below.
How these numbers were measured, and what they are not
The strategy is the MACD line, EMA(12) minus EMA(26) of the close, long only: enter 100 units at market when the line is at or above zero, exit the whole position when it drops below. The series is 320 591 minute bars of WTI, round the clock from 2015-09-23 to 2016-09-02. Our three tracks call the shipped, obfuscated libtse_export.6.0.so from C, from the C++ wrapper and from Python; LEAN runs the same algorithm in C# and in Python, aligned to this side — the same two averages without a signal line, readiness after the slow period, averages seeded with the first close, zero fees and zero slippage on both sides. Each track is the best of three runs of three passes, on both sides alike.
Reference machine: a rented GCP instance, AMD EPYC 7B13, 8 cores, 126 GiB, Ubuntu 26.04.1 LTS, 1-minute load 0.00 at the start of the run. LEAN side: .NET 10.0.404, LEAN built in Release, CPython 3.11. Our tracks built with gcc and g++ 15.2.0, Release, -O3, one thread.
How to read the tables
- run_s is the pass itself: from the first line of main to the summary read back — reading the CSV, building the graph, pushing every bar, taking the result. For LEAN it is LEAN's own completed-in line. This is the column the headline and the chart are built on.
- process_s is run_s plus process start: on this side the loading of the obfuscated library, on LEAN's the start of .NET and its JIT. It is published because it was measured, and it is deliberately left out of the comparison.
- bars/s is the number of bars divided by run_s. LEAN counts data points its own way, by slice elements per subscription, so its own figure differs from bars/s; the table carries bars/s for every track so that the arithmetic is one and the same.
- The Google Benchmark table gives the spread: five repetitions of the C++ wrapper, mean, median and standard deviation in milliseconds, warm-up outside the timed region.
What these numbers are not
- Results are not compared, only speed is. The execution models differ — our simulator buys at the open and sells at the close of the next bar, LEAN fills with its own model — so the two sides trade a different number of times and end with a different profit. Fees and slippage are zero on both sides. Trade counts and profit were a check that each run really traded, not a subject of the measurement, and they are not published here.
- LEAN's trading calendar. LEAN drops bars outside the trading hours of the security type; a US equity would have lost most of a round-the-clock series. The instrument is therefore declared to LEAN as a crypto pair, the one security type whose stock calendar is round the clock. LEAN's market-hours database is not extended.
- Obfuscation is included. The library measured is the one a customer receives, built by the Arkari toolchain with its obfuscation passes. A plain -O3 build would be faster, and nobody receives it.
- Python crosses the ctypes boundary on every bar: the indicator processor is a Python callable, so one pass is over 320 thousand crossings. That is a property of the binding, not a defect of the measurement.
- The machine was quiet: the runner reads the load average and refuses to measure above 1.0; the recorded load was 0.00.
- One of the three Python runs on this side produced no summary line, for a reason not established; the two that did agreed, 6.428 and 6.579 s, and the better of them is the figure shown.
Every measured cell, all five tracks
One robot, one pass — every track
export-C, export-C++ and export-Python call the shipped library; LEAN C# and LEAN Python run the same algorithm on LEAN. Times are the best of three runs of three passes.
| Track | run_s | process_s | bars/s |
|---|---|---|---|
| export-C | 4.366 | 18.725 | 73.4 k |
| export-C++ | 4.360 | 19.267 | 73.5 k |
| export-Python | 6.428 | 24.917 | 49.9 k |
| LEAN C# | 5.070 | 9.859 | 63.2 k |
| LEAN Python | 9.820 | 16.056 | 32.6 k |
Google Benchmark — spread over repetitions
One case, five repetitions, manual timing around the pass with warm-up outside it; milliseconds.
| Case | statistic | time, ms | repetitions |
|---|---|---|---|
| BM_SdkCppSingle | mean | 4317.651 | 5 |
| BM_SdkCppSingle | median | 4320.566 | 5 |
| BM_SdkCppSingle | stddev | 7.229 | 5 |
Source: strategy — MACD benchmark against LEAN, run 20261111-164735, report 20261111_macd_strategy_benchmark_vs_lean.md. Column definitions and caveats: the strategy benchmark methodology document, src/benchmarks/strategy/benchmark_methodology.md.