Skip to content

Skip debug_backtrace for queries under slow threshold#482

Closed
sulimanbenhalim wants to merge 1 commit intolaravel:1.xfrom
sulimanbenhalim:fix/skip-backtrace-under-threshold
Closed

Skip debug_backtrace for queries under slow threshold#482
sulimanbenhalim wants to merge 1 commit intolaravel:1.xfrom
sulimanbenhalim:fix/skip-backtrace-under-threshold

Conversation

@sulimanbenhalim
Copy link
Contributor

Currently resolveLocation() calls debug_backtrace() for every QueryExecuted event regardless of whether the query exceeds the slow threshold. Since the vast majority of queries are fast and will be discarded, this adds unnecessary overhead. This change checks the threshold before capturing the backtrace, skipping it entirely for queries that won't be recorded.

@sulimanbenhalim sulimanbenhalim deleted the fix/skip-backtrace-under-threshold branch February 27, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants