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 <noreply@anthropic.com>
This commit is contained in:
David Montero 2026-06-02 05:10:24 +02:00
parent 909c94c5fb
commit 10d88a44b7
1 changed files with 4 additions and 3 deletions

View File

@ -379,9 +379,10 @@ export class Esp32Bridge {
case 'gpio_change': { case 'gpio_change': {
const pin = msg.data.pin as number; const pin = msg.data.pin as number;
const state = (msg.data.state as number) === 1; const state = (msg.data.state as number) === 1;
console.log( // No per-transition logging here: gpio_change fires on every edge
`[Esp32Bridge:${this.boardId}] gpio_change pin=${pin} state=${state ? 'HIGH' : 'LOW'}`, // (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); this.onPinChange?.(pin, state);
// Also feed the scope path so ESP32 digital pin activity shows // Also feed the scope path so ESP32 digital pin activity shows
// up on the oscilloscope at parity with AVR / RP2040 boards. // up on the oscilloscope at parity with AVR / RP2040 boards.