Files
ThotDjehuty 24556f51d7 release(v2.0.0): finalize PyPI metadata, README rewrite, v2 benchmark + McKean-Vlasov animation
- Restore correct PyPI distribution name 'optimiz-rs' (continuity with v1.0.x).
  Rust crate stays 'optimiz-rs'; Python module is 'optimizr'.
- python/optimizr/__init__.py:
  * Bump __version__ from stale '0.2.0' to '2.0.0'.
  * Eagerly bind every v2 primitive from _core (so dir(optimizr), IDE
    auto-complete and 'from optimizr import X' all work without relying on
    the lazy __getattr__ fallback).
  * Extend __all__ with 38 new v2 entries.
- README.md: full v2 features section grouped by domain (rough volatility,
  BSDE/PDE, stochastic control, mean-field, topology/graphs/signatures,
  risk/robust inference, point processes, Kalman). Embedded
  examples/mckean_vlasov.gif at the top. Added v2 benchmark table.
- examples/benchmark_v2.py: honest benchmark vs pure-Python/NumPy
  references on intrinsically loopy workloads. Best-of-3, single-thread,
  Apple M2: HMM 67.7x, DE 13.9x, signatures 11.2x, Hawkes 3.3x, MCMC 1.7x.
- examples/animate_mckean_vlasov.py + examples/mckean_vlasov.gif (5MB):
  cinematic 800-particle mean-reverting McKean-Vlasov flow animation
  using optimizr.mean_reverting_mckean_vlasov.
- tests/test_v2_api.py already in place: 20/20 pass.
2026-05-14 21:54:49 +02:00

996 B
Raw Permalink Blame History

optimiz-rs v2.0 benchmark

Best wall-clock over a few runs. Single-threaded. Workloads chosen to be intrinsically loopy / sequential -- the regime where the Rust core delivers a real speedup over a NumPy reference.

Workloads that are fully vectorisable in NumPy (e.g. drift updates for an N-particle SDE with no callback) are not included: a tight NumPy loop on contiguous arrays is hard to beat from Rust through a PyO3 callback boundary.

Workload Pure Python / NumPy optimiz-rs (Rust) Speedup
HMM Baum-Welch (2 states, 5_000 obs, 10 iters) 970.94 ms 14.34 ms ** 67.7×**
Differential evolution (Rastrigin d=5, 50 iters x 20 pop) 417.45 ms 30.03 ms ** 13.9×**
Path signature (T=300, d=3, depth=3) 11.07 ms 0.99 ms ** 11.2×**
MCMC random-walk MH (5000 samples, d=2) 35.41 ms 20.24 ms ** 1.7×**
Hawkes process (T=100.0, mu=1.0, alpha=0.6, beta=1.2) 2.75 ms 0.83 ms ** 3.3×**