Skip to content

Debugging ESP32 project with multiple threads can be very slow #3443

@drorgl

Description

@drorgl

For example a project with 20 threads, totaling 26 threads (main, IDLE, IDLE, ipc0, ipc1, esp_timer) can take 6-8 seconds to step.

I've analyzed the problem and it seems its in this package or in platformio-vscode-debug, while the source code was not available it does seem similar to Enneary/module-debug.

Digging in the requests that cause the slow down in GDB, it seems that even when the REGISTERS and CALL STACK debugger panes are collapsed, the plugin still requests the underlying register-values and threads.

The threads or info threads is very slow in ESP32/GDB and takes most of the time between step / next.

It would seem like an easy fix to speed things up for someone who understands how VSCode debugger extension works: check if the pane is open and if not, don't request the data needed to update it.

Attempting to increase the debug_speed didn't help.

While you're at it, add a check for PERIPHERALS pane as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions