code wiki / _hdl_build / nx_compile_perf.nx

nx_compile_perf.nx

buildroot/runtime/_hdl_build/nx_compile_perf.nx

2784 B57 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic compile
docsdependenciesstructsconstsfunctions

about

nx_compile_perf.nx -- the Engineer's COMPILE-TROUBLESHOOTING capability (operator: "if compile is slow research how teams address this to troubleshoot quickly"). Grounded in the established practice (ccache, incremental builds, parallel -j, clang -ftime-trace / gcc -ftime-report profiling, bisection): - the Engineer picks the right LEVER by symptom: a HANG -> bisect-to-function + split (nx_hang_resolve); SLOW-but-completes -> CACHE (skip unchanged modules by source-hash, the #1 win since the team recompiles whole files), + INCREMENTAL (only changed), + PARALLEL (-j), + PROFILE (find the hot fn). - all under the operator's SLA: troubleshoot in <=3 steps; a CACHE HIT is the 1-step optimal (~instant). license_tier: ORIGINAL Pairs with nx_hang_resolve + nx_build_safe. Refs: ccache; clang -ftime-trace (aras-p.info); gcc -ftime-report/-H; Clang Build Analyzer.

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_compile_perf.nx nx_compile_perf_test.nx

imports: nx_syscalls.nx

imported by: nx_compile_perf_test.nx

structs

none

consts

13const CP_LEVER_CACHE: i64 = 1
14const CP_LEVER_INCREMENTAL: i64 = 2
15const CP_LEVER_PARALLEL: i64 = 3
16const CP_LEVER_PROFILE: i64 = 4
17const CP_LEVER_BISECT_SPLIT:i64 = 5
19const CP_SYMPTOM_HANG: i64 = 1
20const CP_SYMPTOM_SLOW: i64 = 2

functions

23func cp_lever_for(symptom: i64) -> i64
called by 1: main
29func cp_cache_hit(source_hash: i64, cached_hash: i64) -> i64 { if source_hash == cached_hash { return 1 } return 0 }
called by 1: main
32func cp_cache_speedup_permil(total_modules: i64, unchanged_modules: i64) -> i64
called by 1: main
38func cp_parallel_time(serial_time: i64, modules: i64, cores: i64) -> i64
called by 1: main
45func cp_hottest(times: *i64, n: i64) -> i64
called by 1: main
52func cp_troubleshoot_steps(symptom: i64, cache_hit: i64) -> i64
called by 1: main
57func cp_within_sla(steps: i64) -> i64 { if steps <= 3 { return 1 } return 0 }
called by 1: main