code wiki / (root) / sketch_hll_packed_vs_hll8_bench.nx

sketch_hll_packed_vs_hll8_bench.nx

buildroot/runtime/sketch_hll_packed_vs_hll8_bench.nx

2493 B89 linesdepth 7pulls 13 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_hll_packed_vs_hll8_bench.nx -- 6-bit register memory bench. CLAIM TO VALIDATE: HLL_packed uses 6-bit registers (rho values cap at 63, more than enough for cardinalities up to 2^63). 6/8 = 25% memory reduction vs HLL_8. No exception table needed -- 6 bits suffices unlike HLL_4's 4 bits. Cleaner trade-off than HLL_4 (no exception path). WORKLOAD: Stream 10000 distinct keys at lg_k=10 into both. MEMORY: HLL_8 (lg_k=10): 1024 bytes regs + 32 header = 1056 B HLL_packed (lg_k=10): ceil(1024 * 6 / 8) = 768 bytes regs + 40 header = 808 B Reduction: ~23%.

dependencies 5 imports · 0 importers

syscalls.nx sketch_hll.nx sketch_hll_packed.nx sketch_comparator.nx sketch_types.nx sketch_hll_packed_vs_hll8_benc

imports: syscalls.nxsketch_hll.nxsketch_hll_packed.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_hll_alloc nx_hll6_alloc write_bp nx_hll_add murmur3_32 mm_load_u32_le mm_rotl32 nx_clz32 nx_bits_clz32 nx_hll6_add murmur3_32 ↻ nx_clz32 ↻ nx_hll6_get nx_hll6_set 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 nx_hll_bias_lgk10 nx_hll_log2_ppm nx_hll_bias_correct nx_hll_bias_table_n ↻ nx_hll_bias_table_get ↻ nx_mulshl_div_i64 nx_i128_alloc nx_i128_mul_i64 nx_i128_mul_u64 nx_i128_neg nx_i128_shl nx_i128_div_i64 nx_i128_is_neg nx_i128_neg ↻

structs

none

consts

none

functions

23func iabs_p(x: i64) -> i64
called by 1: main
28func write_bp(buf: *u8, value: i64) -> i64
called by 1: main
39func main() -> i64