From 10d88a44b75b9501cc74a8bff04d0acb34819f3f Mon Sep 17 00:00:00 2001 From: David Montero Date: Tue, 2 Jun 2026 05:10:24 +0200 Subject: [PATCH] perf(esp32): drop per-edge gpio_change console.log that throttled the sim Esp32Bridge logged every GPIO transition (one per SPI clock edge on a display-heavy sketch), which floods the console and measurably throttles the main thread and simulation throughput. A full-screen 320x240 ILI9341 raycaster went from ~0.3-0.6 FPS to ~6-8 FPS once this log was removed. Keep the functional onPinChange / oscilloscope callbacks intact. Co-Authored-By: Claude Opus 4.8 --- frontend/src/simulation/Esp32Bridge.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/simulation/Esp32Bridge.ts b/frontend/src/simulation/Esp32Bridge.ts index 944cb616..04079101 100644 --- a/frontend/src/simulation/Esp32Bridge.ts +++ b/frontend/src/simulation/Esp32Bridge.ts @@ -379,9 +379,10 @@ export class Esp32Bridge { case 'gpio_change': { const pin = msg.data.pin as number; const state = (msg.data.state as number) === 1; - console.log( - `[Esp32Bridge:${this.boardId}] gpio_change pin=${pin} state=${state ? 'HIGH' : 'LOW'}`, - ); + // No per-transition logging here: gpio_change fires on every edge + // (e.g. each SPI clock pulse on a display-heavy sketch), so logging + // it floods the console and measurably throttles the main thread and + // simulation throughput. Keep only the functional callbacks below. this.onPinChange?.(pin, state); // Also feed the scope path so ESP32 digital pin activity shows // up on the oscilloscope at parity with AVR / RP2040 boards.