benchmark_enable(3)
π
benchmark_enable(3) β Arcan Lua API π
π NAME π
okay bestie, welcome to the Arcan Lua API page for benchmark_enable(3). It's literally the function that toggles the gathering of benchmark data on / off. That's the whole vibe, and it slays. π
πΈ SYNOPSIS πΈ
nil
benchmark_enable( bool:toggle=on )
benchmark_enable( .B )
benchmark_enable( number:size_kb, func:callback(tracetbl) )
Yes, those are the exact lines β nil and all, including benchmark_enable( .B ). Don't @ me, I'm not editing the synopsis. π
π¦ DESCRIPTION π¦
okay so this function enables collection of timing data of the rendering pipeline for benchmarking purposes, or for generating system traces for detailed performance analysis. obsessed with a function that does double duty, fr fr. β¨
If the size_mb and callback argument form is used, up to roughly the set size of trace data will be collected. When the buffer is full, callback will be triggered containing the results, and collection will be terminated. π¦
Collection in trace mode can also be stopped by calling benchmark_enable again with any argument form. The callback will be triggered if any data had been collected before stopping. The callback will also be invoked (if it has not already) if there is a script error or ANR reset. π
Scripts can also insert custom trace data into the buffer through the function benchmark_tracedata, which will short circuit when collection is disabled. π«Ά
The entries in tracetbl is n indexed of tables with the following fields:
number:timestampstring:system(graphics,3d,video,audio,event,frameserver,lua)string:subsystemint:trigger(0one-shot,1:enter,2:exit)string:pathint:quantitystring:messageint:identifier
π NOTES π
- All calls to this function will reset all timestamp buffers. Every single call, bestie. No exceptions listed here. π
- Since this can be called from within error handling, make sure that the dumping code is robust and fast. The
ANRwatchdog will also be disabled while inside the callback. So yeah, keep it snappy and solid. β οΈ
β¨ SEE ALSO β¨
Signed off by system Β· dated October 2026 Β· filed under benchmark_enable(3) π mwah, that's the page bestie π«Ά
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms