Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add periodic perf summary log (every 5s)

Logs avg/max frame time, paint_max, present_max, slow frame count,
and active voices every 300 frames. Shows up in journal for
diagnosing FPS drops on different hardware.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+24
+24
fedac/native/src/ac-native.c
··· 3447 3447 }; 3448 3448 perf_record(&pr); 3449 3449 3450 + // Log perf summary every 5 seconds (300 frames @ 60fps) 3451 + { 3452 + static uint32_t perf_log_max = 0, perf_log_sum = 0; 3453 + static uint16_t perf_log_paint_max = 0, perf_log_pres_max = 0; 3454 + static int perf_log_slow = 0; // frames > 20ms 3455 + if (pr.total_us > perf_log_max) perf_log_max = pr.total_us; 3456 + if (pr.paint_us > perf_log_paint_max) perf_log_paint_max = pr.paint_us; 3457 + if (pr.present_us > perf_log_pres_max) perf_log_pres_max = pr.present_us; 3458 + perf_log_sum += pr.total_us; 3459 + if (pr.total_us > 20000) perf_log_slow++; 3460 + if (main_frame % 300 == 299) { 3461 + ac_log("[perf] f=%d avg=%.1fms max=%.1fms paint_max=%.1fms pres_max=%.1fms slow=%d voices=%d\n", 3462 + (int)main_frame, 3463 + perf_log_sum / 300.0f / 1000.0f, 3464 + perf_log_max / 1000.0f, 3465 + perf_log_paint_max / 1000.0f, 3466 + perf_log_pres_max / 1000.0f, 3467 + perf_log_slow, pr.voices); 3468 + perf_log_max = 0; perf_log_sum = 0; 3469 + perf_log_paint_max = 0; perf_log_pres_max = 0; 3470 + perf_log_slow = 0; 3471 + } 3472 + } 3473 + 3450 3474 // Write frame marker to ftrace ring buffer for BPF correlation. 3451 3475 // Only active when /tmp/.trace-active exists (zero cost otherwise). 3452 3476 {