Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-5923] Improved thread recording #992

Merged
merged 28 commits into from
Feb 16, 2021
Merged

[PLAT-5923] Improved thread recording #992

merged 28 commits into from
Feb 16, 2021

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Feb 5, 2021

Goals

  • Enable recording the main thread's stack trace (required for some upcoming functionality.)
  • Reduce overhead when logging unhandled errors.

Changeset

Added 2 new (private) methods on BugsnagThread:

  • +allThreads:callStackReturnAddresses: (replaces -[BSG_KSCrash captureThreads:depth:recordAllThreads:])
  • +mainThread

Other threads are now suspended for a shorter period of time while their backtraces are being captured, and resumed before symbolication starts.

Testing

Manually tested to verify correctness and measure performance improvement.

Using a sample app, performance was measured by calling notify() 100 times in a loop to obtain reproducible figures for the execution time. The results were:

Thread send policy Before After
.always 48ms 7ms
.unhandledOnly 43ms 6ms

Unit test cases have been added to verify the new functionality.

@github-actions
Copy link

github-actions bot commented Feb 5, 2021

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size increased by 1,056 bytes from 1,060,400 to 1,061,456

Generated by 🚫 Danger

@nickdowell nickdowell marked this pull request as ready for review February 8, 2021 13:01
@nickdowell nickdowell changed the title [PLAT-5923 ] Improved thread recording [PLAT-5923] Improved thread recording Feb 8, 2021
@nickdowell nickdowell requested a review from kstenerud February 16, 2021 10:39
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