Skip to content

perf: DebugStackTrace no longer creates a stack trace for dynamic methods#4954

Open
jamescrosswell wants to merge 5 commits intomainfrom
refemit
Open

perf: DebugStackTrace no longer creates a stack trace for dynamic methods#4954
jamescrosswell wants to merge 5 commits intomainfrom
refemit

Conversation

@jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Feb 24, 2026

resolves: #4939

#skip-changelog

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.88%. Comparing base (c13180b) to head (e7842e7).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
src/Sentry/Internal/DebugStackTrace.cs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4954   +/-   ##
=======================================
  Coverage   73.88%   73.88%           
=======================================
  Files         496      496           
  Lines       17951    17954    +3     
  Branches     3516     3517    +1     
=======================================
+ Hits        13263    13266    +3     
- Misses       3826     3827    +1     
+ Partials      862      861    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Removed duplicate entry for DebugStackTrace feature.
@jamescrosswell jamescrosswell marked this pull request as ready for review February 25, 2026 03:46

var assembly = options.FileSystem.OpenFileForReading(assemblyName);
return new PEReader(assembly);
if (options.FileSystem.FileExists(assemblyName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I guess it's not too easy - or better to say "economic" - to add a unit test for this, right?

Copy link
Collaborator Author

@jamescrosswell jamescrosswell Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could possibly be done. This isn't really a functional change though (it doesn't change the behaviour of our SDK)... it's more of a performance change. We're avoiding using exceptions for control flow here and the need to create stack traces for those exceptions.

Given that it's not a functional change, I think a unit test would be overkill... And we could create a benchmark but, again, kind of pointless since we know it's going to be quicker than the previous/alternative code.

@jamescrosswell jamescrosswell requested a review from Flash0ver March 5, 2026 22:53
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.

When Application Includes a Refit Assembly, Many System.IO.IOExceptions Are Thrown

2 participants