code wiki / (root) / nx_bench_hll_throughput.nx

nx_bench_hll_throughput.nx

buildroot/runtime/nx_bench_hll_throughput.nx

3420 B115 linesdepth 6pulls 13 transitivereach 0 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_hll_throughput.nx -- head-to-head HLL throughput bench. Per user directive 2026-05-14: "use all of this to beat apache data sketches, we are slower and worse and we want to prove not only are we the leader in math but it applies all the way up the chain in performance". Drives nx_sketch_hll with a deterministic xorshift64 PRNG key stream, measures update_count + HLL estimate + monotonic-clock elapsed; the script computes items/sec from update_count / elapsed. Uses the proven print_i64 / println / nx_clock_monotonic_ns helpers; no per-bench reimplementation. genealogy_id: substrate_perf_bench_2026_05_14 lineage_id: incumbent_displacement_proof

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_clock.nx nx_sketch_hll.nx nx_bench_hll_throughput.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_clock.nxnx_sketch_hll.nx

imported by: nobody (leaf or entry point)

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

main nx_hll_alloc sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mmap ↻ nx_clock_monotonic_ns sys_mmap ↻ sys_clock_gettime_mono nx_bench_xorshift64 nx_bench_i64_to_bytes nx_hll_add murmur3_32 mm_load_u32_le mm_rotl32 nx_clz32 nx_bits_clz32 nx_hll_estimate nx_hll_pow2_neg_q32 nx_hll_alpha_m_sq_q64 nx_hll_bias_table_n nx_hll_bias_table_get nx_hll_bias_lgk4 nx_hll_bias_lgk5 nx_hll_bias_lgk6 nx_hll_bias_lgk7 nx_hll_bias_lgk8 nx_hll_bias_lgk9

structs

none

consts

29const NX_MAGIC_1000000000: i64 = 1000000000
30const NX_MAGIC_1000000: i64 = 1000000
32const NX_BENCH_HLL_N: nx_int = 100000
33const NX_BENCH_HLL_LGK: nx_int = 10
34const NX_BENCH_HLL_SEED: nx_int = 1442695040888963407

functions

36func nx_bench_xorshift64(state_p: *nx_int) -> nx_int
called by 1: main
45func nx_bench_i64_to_bytes(v: nx_int, out: *u8)
called by 1: main
56func main() -> nx_exit