code wiki / _hdl_build / nx_dod_cache.nx

nx_dod_cache.nx

buildroot/runtime/_hdl_build/nx_dod_cache.nx

1517 B26 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_dod_cache.nx -- P3: measured cache-traffic model for DATA-ORIENTED (SoA/ECS) vs ARRAY-OF-STRUCTS (AoS / classic OOP layout). When a system uses A of F fields per entity: AoS drags the WHOLE struct array through cache (you pay for all F fields even though you use A); SoA stores each field contiguously so you stream only the A arrays you touch. Memory traffic (cache lines) is the binding cost on weak cores (deep-research: DOD = "efficient usage of the CPU cache ... SoA vs AoS"). Pure integer. license_tier: ORIGINAL

dependencies 0 imports · 1 importers

nx_dod_cache.nx nx_dod_cache_gate.nx

imports: none

imported by: nx_dod_cache_gate.nx

structs

none

consts

7const DC_BELOW: i64 = 0
8const DC_PARITY: i64 = 1
9const DC_EXCEEDS: i64 = 2

functions

11func dc_ceil_div(a: i64, b: i64) -> i64 { return (a + b - 1) / b }
14func dc_aos_lines(n: i64, fields: i64, bpf: i64, line: i64) -> i64 { return dc_ceil_div(n * fields * bpf, line) }
called by 1: main calls 1: dc_ceil_div
16func dc_soa_lines(n: i64, accessed: i64, bpf: i64, line: i64) -> i64 { return dc_ceil_div(n * accessed * bpf, line) }
called by 1: main calls 1: dc_ceil_div
19func dc_verdict(aos: i64, soa: i64) -> i64
called by 1: main
26func dc_aos_util_permil(accessed: i64, fields: i64) -> i64 { return accessed * 1000 / fields }
called by 1: main