aacb9280f1
## Summary An honest, tiered cross-library benchmark — and the optimization pass it triggered. ### Performance (wickra-core, outputs unchanged) Profiling against the other Rust TA crates exposed real inefficiencies. Each benchmarked indicator is now **5–79% faster** in both streaming and batch: - **SMA, Bollinger**: flat `Box<[f64]>` ring buffers replace `VecDeque` (−69…79%). - **RSI**: `100·ag/(ag+al)` collapses three divisions into one; Wilder smoothing hoists `1/period` out of the hot path (−46%). - **ATR**: reciprocal hoisted (−42%). - **EMA/RSI/ATR**: per-tick `Option<f64>` hot state → bare `f64` + ready flag. Net result vs `kand`: Wickra now wins **RSI, Bollinger and ATR** (streaming), and ties `ta-rs` on SMA — up from losing every indicator 1.5–6× before. ### Benchmark harness New `crates/wickra-bench` (publish=false): a Criterion benchmark comparing Wickra against `kand`, `ta-rs` and `yata` on an identical BTCUSDT candle series, in streaming and batch modes. Peer APIs were verified against their source, not guessed. Wired into the nightly `cross-library-bench` workflow as a separate job. ### Honest README The benchmark section is rewritten into three layered tables (Rust core vs Rust crates; Python vs the Python ecosystem) that **show the losses as well as the wins**. The "only library that combines…" claim is gone; the new framing is breadth + multi-language reach + the deliberate safety trade-off that costs raw speed. Added an origin/why-slower rationale and a star CTA. ### Python benchmark Added `tulipy` runners and expanded per-tick streaming coverage to SMA/EMA/RSI/ MACD/Bollinger. `bench.in`/`bench.txt` now lock `TA-Lib` + `tulipy` (hash-pinned); `pandas-ta` stays out (it requires Python ≥ 3.12, the bench runs on 3.11). ### Notes - TA-Lib/tulipy numbers in the README Python table are marked ⧗ — they are produced by the CI Linux job (C extensions don't build cleanly on every desktop), not measured locally. - The matching `wickra-docs` prose update is committed separately and will be pushed with the release, per the docs-don't-lead-the-registries rule. Verified locally: `cargo fmt`, `cargo test --workspace --all-features` (3413 core + bindings), `cargo clippy --workspace --all-targets --all-features -D warnings`, Node build + 498 tests, and pytest all green.
65 lines
1.8 KiB
TOML
65 lines
1.8 KiB
TOML
[build-system]
|
|
requires = ["maturin>=1.7,<2.0"]
|
|
build-backend = "maturin"
|
|
|
|
[project]
|
|
name = "wickra"
|
|
version = "0.5.8"
|
|
description = "Streaming-first technical indicators: incremental, fast, install-free."
|
|
readme = "README.md"
|
|
license = "MIT OR Apache-2.0"
|
|
authors = [{ name = "kingchenc", email = "support@wickra.org" }]
|
|
requires-python = ">=3.9"
|
|
keywords = ["finance", "trading", "indicators", "technical-analysis", "ta-lib"]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Intended Audience :: Financial and Insurance Industry",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3 :: Only",
|
|
"Programming Language :: Python :: 3.9",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Programming Language :: Rust",
|
|
"Topic :: Office/Business :: Financial :: Investment",
|
|
"Topic :: Scientific/Engineering :: Mathematics",
|
|
]
|
|
dependencies = [
|
|
"numpy>=1.22",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
test = [
|
|
"pytest>=7",
|
|
"numpy>=1.22",
|
|
"hypothesis>=6",
|
|
]
|
|
bench = [
|
|
"pytest-benchmark>=4",
|
|
"TA-Lib; platform_system != 'Windows'",
|
|
"pandas-ta>=0.3.14b",
|
|
"tulipy>=0.4; platform_system != 'Windows'",
|
|
"talipp>=2",
|
|
"finta>=1.3",
|
|
"pandas>=2",
|
|
"numpy>=1.22",
|
|
]
|
|
|
|
[project.urls]
|
|
Homepage = "https://github.com/wickra-lib/wickra"
|
|
Repository = "https://github.com/wickra-lib/wickra"
|
|
Issues = "https://github.com/wickra-lib/wickra/issues"
|
|
|
|
[tool.maturin]
|
|
manifest-path = "Cargo.toml"
|
|
python-source = "python"
|
|
module-name = "wickra._wickra"
|
|
features = ["pyo3/extension-module"]
|
|
strip = true
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
addopts = "-ra -q"
|
|
filterwarnings = ["error"]
|