Iterflow: Composable Streaming Statistics for JavaScript

Read full text
Authors: Gaurav Singh
Cited by: 0

Abstract

We present iterflow, a zero-dependency JavaScript library that integrates online statistical algorithms into lazy iterator pipelines. ES2025 Iterator Helpers provide lazy transforms but no statistics; libraries like @stdlib/stats/incr provide streaming accumulators but not as composable pipeline stages. iterflow bridges this gap: Welford's variance, EWMA, streaming Pearson correlation, z-score anomaly detection, and monotonic deque windowed extrema are implemented as chainable pipeline stages that compose with map, filter, window, and take while preserving lazy evaluation and O(1) memory per stage. Benchmarks on synthetic workloads show a 296x throughput improvement over eager array pipelines with early termination at N=10^6, and a 780x improvement for streaming versus recomputed correlation at N=10^4. For standalone single-statistic computation, the generator-based design incurs 3-5x overhead relative to hand-written loops.

Fields of Study & Subjects

Advanced Database Systems and Queries Parallel Computing and Optimization Techniques Statistical and numerical algorithms

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
22 February 2026
Language
EN