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)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_tdigest_alloc nx_tdigest_add nx_tdigest_merge nx_tdigest_sort_buffer nx_tdigest_centroid_at nx_tdigest_w_max nx_tdigest_quantile nx_tdigest_merge ↻ nx_tdigest_centroid_at ↻ iabs_tm nx_tdigest_memory_bytes nx_cmp_memory

structs

none

consts

none

functions

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