code wiki / _hdl_build / nx_compile_perf.nx
nx_compile_perf.nx
buildroot/runtime/_hdl_build/nx_compile_perf.nx
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
imports: nx_syscalls.nx
imported by: nx_compile_perf_test.nx
structs
| none |
consts
| 13 | const CP_LEVER_CACHE: i64 = 1 |
| 14 | const CP_LEVER_INCREMENTAL: i64 = 2 |
| 15 | const CP_LEVER_PARALLEL: i64 = 3 |
| 16 | const CP_LEVER_PROFILE: i64 = 4 |
| 17 | const CP_LEVER_BISECT_SPLIT:i64 = 5 |
| 19 | const CP_SYMPTOM_HANG: i64 = 1 |
| 20 | const CP_SYMPTOM_SLOW: i64 = 2 |
functions
| 23 | func cp_lever_for(symptom: i64) -> i64 called by 1: main |
| 29 | func cp_cache_hit(source_hash: i64, cached_hash: i64) -> i64 { if source_hash == cached_hash { return 1 } return 0 } called by 1: main |
| 32 | func cp_cache_speedup_permil(total_modules: i64, unchanged_modules: i64) -> i64 called by 1: main |
| 38 | func cp_parallel_time(serial_time: i64, modules: i64, cores: i64) -> i64 called by 1: main |
| 45 | func cp_hottest(times: *i64, n: i64) -> i64 called by 1: main |
| 52 | func cp_troubleshoot_steps(symptom: i64, cache_hit: i64) -> i64 called by 1: main |
| 57 | func cp_within_sla(steps: i64) -> i64 { if steps <= 3 { return 1 } return 0 } called by 1: main |