nx_perf_lib.nx
buildroot/runtime/nx_perf_lib.nx
about
dependencies 1 imports · 31 importers
diagram shows first 10 each side; +0 more imports, +21 more importers in the complete lists below.
imports: nx_frame_budget.nx
imported by: nx_craft_before_placement_t316.nxnx_frame_pacing_lib.nxnx_movement_base_engine_t139.nxnx_perf_pct_gate.nxnx_wasm_craft.nxnx_wasm_craft_body_t137.nxnx_wasm_craft_contact_candidate.nxnx_wasm_craft_dunes_t70.nxnx_wasm_craft_gait_candidate.nxnx_wasm_craft_gait_candidate_t139.nxnx_wasm_craft_imported_body_t41.nxnx_wasm_craft_imported_body_t42.nxnx_wasm_craft_imported_body_t49.nxnx_wasm_craft_imported_t262.nxnx_wasm_craft_inspection_bounds_t181.nxnx_wasm_craft_inspection_distance_t218.nxnx_wasm_craft_inspection_t142.nxnx_wasm_craft_journal_index_t21.nxnx_wasm_craft_journal_index_t21_before_t44.nxnx_wasm_craft_lookup_candidate.nxnx_wasm_craft_move_t72.nxnx_wasm_craft_pre_inspection_t142.nxnx_wasm_craft_recovery_t20.nxnx_wasm_craft_relief_adopt_t143.nxnx_wasm_craft_relief_save_t143.nxnx_wasm_craft_relief_t143.nxnx_wasm_craft_residency_t44.nxnx_wasm_craft_turn_candidate_t139.nxnx_wasm_craft_visitors_canonical_t142.nxnx_wasm_craft_visitors_inspection_t142.nxnx_wasm_craft_visitors_t140.nx
structs
| none |
consts
| 26 | const PF_N: i64 = 256 // the window: ~4.3 s at 60 Hz, the same order as the page's 600-frame ?perf probe at 10 s |
| 27 | const PF_HDR: i64 = 8 // header words before the samples (layout below) |
| 28 | const PF_CLAMP_MS: i64 = 1000 // a frame longer than a second is recorded AT the clamp (and still counts as worst) |
| 29 | const PF_HBINS: i64 = 1001 // histogram bins 0..PF_CLAMP_MS inclusive |
| 30 | const PF_WORDS: i64 = 1265 // PF_HDR + PF_N + PF_HBINS -- the region a caller must provide (8 + 256 + 1001) |
| 31 | const PF_UNOBSERVED: i64 = 0 - 1 |
| 32 | const PF_PERMIL: i64 = 1000 |
| 33 | const PF_US_PER_MS: i64 = 1000 |
| 34 | const PF_SPIKE_MULT: i64 = 2 // the shipped-industry jank definition the page already used: a frame above 2x the window median |
| 36 | const PF_H_COUNT: i64 = 0 // samples in the window (<= PF_N) |
| 37 | const PF_H_HEAD: i64 = 1 // next write slot |
| 38 | const PF_H_TOTAL: i64 = 2 // frames ever pushed |
| 39 | const PF_H_WORST: i64 = 3 // worst frame ever (ms, clamped) |
| 40 | const PF_H_OVER: i64 = 4 // frames ever over the budget handed to pf_push |
| 41 | const PF_H_SUM: i64 = 5 // sum of ms ever pushed (clamped values) |
| 42 | const PF_H_BUDGET: i64 = 6 // the budget (ms) the last push was judged against |
| 43 | const PF_H_RESERVED: i64 = 7 |
| 45 | const PF_GREEN: i64 = 0 |
| 46 | const PF_RED: i64 = 1 |
| 47 | const PF_ABSTAIN: i64 = 3 |
| 173 | const PF_LONG_FRAME_MS: i64 = 50 |
functions
| 49 | func pf_words() -> i64 { return PF_WORDS } |
| 50 | func pf_window() -> i64 { return PF_N } |
| 51 | func pf_clamp_ms() -> i64 { return PF_CLAMP_MS } |
| 53 | func pf_init(r: *i64) -> i64 |
| 61 | func pf_valid(r: *i64) -> i64 called by 1: pf_push_raw |
| 68 | func pf_push(r: *i64, ms: i64, budget_ms: i64) -> i64 |
| 74 | func pf_push_raw(r: *i64, ms: i64, budget_ms: i64) -> i64 |
| 88 | func pf_n(r: *i64) -> i64 { return r[PF_H_COUNT] } |
| 89 | func pf_total(r: *i64) -> i64 { return r[PF_H_TOTAL] } |
| 90 | func pf_worst_ever(r: *i64) -> i64 { if r[PF_H_TOTAL] == 0 { return PF_UNOBSERVED } return r[PF_H_WORST] } |
| 91 | func pf_over(r: *i64) -> i64 { return r[PF_H_OVER] } |
| 92 | func pf_budget(r: *i64) -> i64 { return r[PF_H_BUDGET] } |
| 94 | func pf_mean_x10(r: *i64) -> i64 { if r[PF_H_TOTAL] == 0 { return PF_UNOBSERVED } return r[PF_H_SUM]*10 / r[PF_H_TOTAL] } called by 1: main |
| 96 | func pf_sample(r: *i64, i: i64) -> i64 |
| 105 | func pf_hist(r: *i64) -> i64 called by 1: pf_pct |
| 121 | func pf_tail_rank(r: *i64, rank: i64) -> i64 called by 1: pf_pct |
| 138 | func pf_pct(r: *i64, permil: i64) -> i64 |
| 154 | func pf_worst(r: *i64) -> i64 { return pf_pct(r, PF_PERMIL) } |
| 156 | func pf_spikes(r: *i64) -> i64 |
| 174 | func pf_long(r: *i64) -> i64 called by 1: main |
| 185 | func pf_spikes_permil(r: *i64) -> i64 |
| 191 | func pf_budget_ms(fps: i64) -> i64 { if fps <= 0 { return PF_UNOBSERVED } return fb_budget_us(fps) / PF_US_PER_MS } |
| 192 | func pf_fits(ms: i64, budget_ms: i64) -> i64 { return fb_fits(ms * PF_US_PER_MS, budget_ms * PF_US_PER_MS) } |
| 199 | func pf_referee(r: *i64, budget_ms: i64, min_n: i64, p50_permil: i64, p95_permil: i64, p99_permil: i64, jank_permil_max: i64, why: *i64) -> i64 |