code wiki / (root) / sketch_tdigest_vs_materialized_quantile_bench.nx

sketch_tdigest_vs_materialized_quantile_bench.nx

buildroot/runtime/sketch_tdigest_vs_materialized_quantile_bench.nx

2760 B86 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_tdigest_vs_materialized_quantile_bench.nx -- streaming quantile EXCEED. COMPETITIVE TARGET: Mathematica `Quantile[data, 0.99]`, NumPy `np.quantile(a, 0.99)`, R `quantile(x, 0.99)`, SQL `PERCENTILE_CONT(0.99)`. All require sorted/materialized data. SUBSTRATE: T-Digest delta=100 uses ~32KB regardless of N, and supports DETERMINISTIC MERGE across distributed shards (incumbents cannot merge two quantile arrays meaningfully). HARD-WIN GATE: N=100,000 values streamed. T-Digest p99 within 5% of true. T-Digest memory < 50 KB. Materialized cost: 800,000 bytes (raw values) >= 16x larger.

dependencies 4 imports · 0 importers

syscalls.nx sketch_tdigest.nx sketch_comparator.nx sketch_types.nx sketch_tdigest_vs_materialized

imports: syscalls.nxsketch_tdigest.nxsketch_comparator.nxsketch_types.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

22func iabs_tm(x: i64) -> i64
27func main() -> i64