Skip to content

perf(native): optimize Windows stack walking - #2018

Open
jpnurmi wants to merge 2 commits into
masterfrom
jpnurmi/perf/native-stackwalk-win
Open

perf(native): optimize Windows stack walking#2018
jpnurmi wants to merge 2 commits into
masterfrom
jpnurmi/perf/native-stackwalk-win

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Open the crashed process and initialize DbgHelp once while building the native event, then reuse the same symbol-handler session for every captured thread. Clean up the session after all thread stacktraces have been extracted.

Keep the existing module search path active after initializing the shared handler. This avoids repeatedly opening the target process, loading module and symbol state, and tearing DbgHelp down for every thread.

Demote high-volume per-frame, per-thread, per-module, and symbol-candidate diagnostics to trace level so that debug-log formatting and I/O do not inflate crash-processing time or flood the log.

With synthetic 128 workers with a stack depth of 128:

  • Before: ~15-16s
  • After: <1s

Open the crashed process and initialize DbgHelp once while building the native
event, then reuse the same symbol-handler session for every captured thread.
Clean up the session after all thread stacktraces have been extracted.

Keep the existing module search path active after initializing the shared
handler. This avoids repeatedly opening the target process, loading module and
symbol state, and tearing DbgHelp down for every thread.

Demote high-volume per-frame, per-thread, per-module, and symbol-candidate
diagnostics to trace level so debug-log formatting and I/O do not inflate crash
processing time or flood the log.
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.27273% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.36%. Comparing base (162f97a) to head (3d8a3ac).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2018      +/-   ##
==========================================
+ Coverage   74.35%   74.36%   +0.01%     
==========================================
  Files         104      104              
  Lines       26518    26527       +9     
  Branches     4824     4827       +3     
==========================================
+ Hits        19717    19728      +11     
+ Misses       5454     5451       -3     
- Partials     1347     1348       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant