Announcing Quantogram, a crate for computing approximate quantiles
I just published Quantogram, a crate for computing the median or other quantile of a stream of f64 data. The samples may be unweighted (uniform weight of one) or weighted.
The accuracy may be adjusted up or down to tune the memory usage.
See https://crates.io/crates/quantogram
The Quantogram can also yield the min, max, mean and mode, as well as the inverse quantile (quantile corresponding to a specified sample value).
In benchmarks against two existing crates (zw-fast-quantile 0.2 and quantiles 0.7), Quantogram scaled better and was dramatically faster at querying. It falls in between the two libraries for speed of insertion. If your use case is querying streams of data and checking each sample to see if it is an outlier by checking a quantile of the data seen so far, Quantogram will be your best bet.
At 50,000 samples, Quantogram is 30x faster than CKMS from the quantile crate and 118x faster than Zhang Wang from the zw-fast-quantile crate. The performance ratio gets better as the number of samples increases.