code wiki / _hdl_build / nx_build_bench.nx

nx_build_bench.nx

buildroot/runtime/_hdl_build/nx_build_bench.nx

5099 B111 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind benchtopic build
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itoa_lib.nx nx_build_bench.nx

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

main bb_puts sys_write bench sys_mmap bb_cat sys_openat_wr sys_now_ms sys_mmap ↻ sys_clock_gettime_mono bb_run sys_fork sys_mmap ↻ sys_dup3 sys_openat_wr ↻ sys_execve sys_exit sys_wait4 sys_close bb_filesize sys_openat_rd sys_mmap ↻ sys_read sys_close ↻ bb_puts ↻ bb_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sys_exit ↻

structs

none

consts

12const BB_MAGIC_33554432: i64 = 33554432
13const BB_MAGIC_1024: i64 = 1024
15const BB_CC: *u8 = "_offc/nx_cc_sovereign.elf"
16const BB_ASM: *u8 = "_offc/nxasm_x86_main.elf"

functions

18func 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 }
called by 2: benchmain calls 1: sys_write
23func bb_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: bench calls 1: nxi_out
24func 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
27func bb_run(elf: *u8, a1: *u8, a2: *u8, out_fd: i64) -> i64
54func bb_filesize(path: *u8) -> i64
69func bench(name: *u8) -> i64
104func main() -> i64