code wiki / _hdl_build / nx_build_bench.nx
nx_build_bench.nx
buildroot/runtime/_hdl_build/nx_build_bench.nx
about
nx_build_bench.nx -- MEASURE the build/compile pipeline speed, per phase, natively.
Times the two sovereign build phases the WOMB runs, with the clock read IN-ORGAN (sys_now_ms)
around each fork+exec (sovereign, not a host stopwatch):
PHASE 1 compile : _offc/nx_cc_sovereign.elf <module.nx> (stdout -> /tmp/<m>.s)
PHASE 2 assemble: _offc/nxasm_x86_main.elf <m>.s <m>.elf
Reports compile_ms / assemble_ms / .s+.elf bytes / throughput across a small, medium, and large
organ, and names the bottleneck -- so build-speed optimization is evidence-based, not "30 is ok".
Sovereign: imports only nx_syscalls. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const BB_MAGIC_33554432: i64 = 33554432 |
| 13 | const BB_MAGIC_1024: i64 = 1024 |
| 15 | const BB_CC: *u8 = "_offc/nx_cc_sovereign.elf" |
| 16 | const BB_ASM: *u8 = "_offc/nxasm_x86_main.elf" |
functions
| 18 | func bb_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(1, s, n); return 0 } |
| 23 | func bb_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 24 | func bb_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != 0 as u8 { dst[off + i] = s[i]; i = i + 1 } return off + i } called by 1: bench |
| 27 | func bb_run(elf: *u8, a1: *u8, a2: *u8, out_fd: i64) -> i64 |
| 54 | func bb_filesize(path: *u8) -> i64 |
| 69 | func bench(name: *u8) -> i64 |
| 104 | func main() -> i64 |