From a707eb5d62d3c9cae984c360d1fed316358fefba Mon Sep 17 00:00:00 2001 From: kingchenc Date: Sat, 23 May 2026 00:24:41 +0200 Subject: [PATCH] docs: refresh the cross-library benchmark numbers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The README and Streaming-vs-Batch benchmark tables were a stale snapshot ("5 000-bar series", numbers from an older machine). Re-run `python -m benchmarks.compare_libraries` on the current hardware against the same peer set (finta + talipp; TA-Lib and pandas-ta stay excluded on Windows) and replace the tables with the fresh numbers. The new run uses the script's current defaults: a 20 000-bar batch series and a 5 000-bar seed + 15 000-bar live streaming workload — both more representative of real backtests than the previous 5 000 / 2 000-bar sizes. Wickra still wins every batch row outright (3.5× to 1 244× faster than the nearest peer) and the streaming RSI is ~13.8× faster than talipp's incremental implementation. --- README.md | 22 +++++++++++----------- docs/wiki/Streaming-vs-Batch.md | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index a69c7aad..a9867524 100644 --- a/README.md +++ b/README.md @@ -57,28 +57,28 @@ Lower µs/op = faster. Wickra wins every batch category outright, and the streaming gap widens linearly with how much history a batch-only library has to recompute on every tick. -### Batch — single full pass over a 5 000-bar series +### Batch — single full pass over a 20 000-bar series Reading the table: each cell shows that library's runtime, plus how many times slower it is than Wickra in parentheses. **★** marks the winner per row. -| Indicator | Wickra | finta | talipp | -|---------------------|---------------------|------------------------|------------------------------| -| SMA(20) | **26.0 µs ★** | 295.3 µs (11.4× slower) | 1 812.8 µs (69.7× slower) | -| EMA(20) | **16.8 µs ★** | 205.5 µs (12.2× slower) | 2 534.4 µs (150.9× slower) | -| RSI(14) | **31.2 µs ★** | 714.1 µs (22.9× slower) | 3 751.7 µs (120.2× slower) | -| MACD(12, 26, 9) | **30.8 µs ★** | 359.5 µs (11.7× slower) | 11 642.2 µs (378.0× slower) | -| Bollinger(20, 2.0) | **26.7 µs ★** | 690.6 µs (25.9× slower) | 27 482.4 µs (1 030.1× slower) | -| ATR(14) | **40.6 µs ★** | 1 120.3 µs (27.6× slower) | 3 760.2 µs (92.7× slower) | +| Indicator | Wickra | finta | talipp | +|---------------------|---------------------|-----------------------------|-------------------------------| +| SMA(20) | **95.6 µs ★** | 343.5 µs (3.6× slower) | 7 640.6 µs (79.9× slower) | +| EMA(20) | **64.6 µs ★** | 223.1 µs (3.5× slower) | 12 160.9 µs (188.2× slower) | +| RSI(14) | **126.2 µs ★** | 1 107.1 µs (8.8× slower) | 15 792.2 µs (125.1× slower) | +| MACD(12, 26, 9) | **119.0 µs ★** | 531.8 µs (4.5× slower) | 49 788.1 µs (418.2× slower) | +| Bollinger(20, 2.0) | **105.3 µs ★** | 812.0 µs (7.7× slower) | 130 938.3 µs (1 243.7× slower)| +| ATR(14) | **123.5 µs ★** | 5 144.8 µs (41.7× slower) | 28 816.0 µs (233.4× slower) | -### Streaming — per-tick latency after seeding with 2 000 historical bars +### Streaming — per-tick latency after seeding with 5 000 historical bars A batch-only library has to re-run its full indicator over the entire history on every new tick; Wickra updates state in O(1). | Indicator | Wickra (per tick) | talipp (per tick) | |-----------|---------------------|---------------------------| -| RSI(14) | **0.07 µs ★** | 1.16 µs (17.5× slower) | +| RSI(14) | **0.119 µs ★** | 1.644 µs (13.8× slower) | > TA-Lib and pandas-ta are not included here because both fail to install > cleanly on Windows without C build tooling — which is precisely the install diff --git a/docs/wiki/Streaming-vs-Batch.md b/docs/wiki/Streaming-vs-Batch.md index a69655a8..88cae89e 100644 --- a/docs/wiki/Streaming-vs-Batch.md +++ b/docs/wiki/Streaming-vs-Batch.md @@ -115,26 +115,26 @@ history just to recompute it. The numbers below are reproduced from the project README, where `python -m benchmarks.compare_libraries` is the source script. -### Batch — single full pass over a 5 000-bar series +### Batch — single full pass over a 20 000-bar series -| Indicator | Wickra | finta | talipp | -|---------------------|---------------------|------------------------|------------------------------| -| SMA(20) | **26.0 µs** | 295.3 µs (11.4× slower) | 1 812.8 µs (69.7× slower) | -| EMA(20) | **16.8 µs** | 205.5 µs (12.2× slower) | 2 534.4 µs (150.9× slower) | -| RSI(14) | **31.2 µs** | 714.1 µs (22.9× slower) | 3 751.7 µs (120.2× slower) | -| MACD(12, 26, 9) | **30.8 µs** | 359.5 µs (11.7× slower) | 11 642.2 µs (378.0× slower) | -| Bollinger(20, 2.0) | **26.7 µs** | 690.6 µs (25.9× slower) | 27 482.4 µs (1 030.1× slower) | -| ATR(14) | **40.6 µs** | 1 120.3 µs (27.6× slower) | 3 760.2 µs (92.7× slower) | +| Indicator | Wickra | finta | talipp | +|---------------------|---------------------|-----------------------------|-------------------------------| +| SMA(20) | **95.6 µs** | 343.5 µs (3.6× slower) | 7 640.6 µs (79.9× slower) | +| EMA(20) | **64.6 µs** | 223.1 µs (3.5× slower) | 12 160.9 µs (188.2× slower) | +| RSI(14) | **126.2 µs** | 1 107.1 µs (8.8× slower) | 15 792.2 µs (125.1× slower) | +| MACD(12, 26, 9) | **119.0 µs** | 531.8 µs (4.5× slower) | 49 788.1 µs (418.2× slower) | +| Bollinger(20, 2.0) | **105.3 µs** | 812.0 µs (7.7× slower) | 130 938.3 µs (1 243.7× slower)| +| ATR(14) | **123.5 µs** | 5 144.8 µs (41.7× slower) | 28 816.0 µs (233.4× slower) | -### Streaming — per-tick latency after seeding with 2 000 historical bars +### Streaming — per-tick latency after seeding with 5 000 historical bars | Indicator | Wickra (per tick) | talipp (per tick) | |-----------|---------------------|---------------------------| -| RSI(14) | **0.07 µs** | 1.16 µs (17.5× slower) | +| RSI(14) | **0.119 µs** | 1.644 µs (13.8× slower) | The streaming gap widens linearly with how much history a batch-only library -has to recompute on every new tick; the table above is the gap at a modest -2 000-bar seed. +has to recompute on every new tick; the table above is the gap at a 5 000-bar +seed followed by 15 000 live updates. ## Practical consequences