Skip to content

Disable statement handler when not connected#1059

Open
carlos-granados wants to merge 1 commit intoxdebug:masterfrom
carlos-granados:disable-statement-handler-when-not-connected
Open

Disable statement handler when not connected#1059
carlos-granados wants to merge 1 commit intoxdebug:masterfrom
carlos-granados:disable-statement-handler-when-not-connected

Conversation

@carlos-granados
Copy link
Contributor

  • Disable statement handler if we don't connect to a debugging client at start up (unless coverage mode is enabled, in which case it needs to remain enabled)
  • Enable it again if later on we connect to a debugging client
  • There are a couple of places where we also need to temporarily enable it when we set do_connect_to_client to true. The code that acts upon this flag is called from the statement handler, so we need to enable it so that it can try to connect. If it does not connect, it will be disabled again

This provides a performance gain between 1% and 10% depending on the type of application that we are running. See some benchmarking results here: https://github.com/carlos-granados/xdebug/actions/runs/21043818969

@carlos-granados carlos-granados force-pushed the disable-statement-handler-when-not-connected branch from 47d423f to cc0005b Compare January 21, 2026 05:02
@carlos-granados carlos-granados force-pushed the disable-statement-handler-when-not-connected branch from cc0005b to 5941530 Compare January 28, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants