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-6798] Improve breadcrumbs performance with async file I/O #1124

Merged
merged 10 commits into from
Jun 24, 2021

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Jun 18, 2021

Goal

To reduce the overhead of leaving breadcrumbs by performing filesystem I/O on a background queue.

Changeset

Breadcrumbs are now stored in memory as a linked list of JSON encoded C strings that are read at crash time or for calls to notify().

File writing now occurs asynchronously on a dedicated serial dispatch_queue to free up the calling thread and avoid provoking filesystem contention.

Use of @synchronized and customized getters & setters in BugsnagBreadcrumb has been removed - breadcrumbs objects are not shared across threads so there is no need for the overhead.

Testing

Added a unit test case to verify that interrupted updates writes to the breadcrumbs linked list do not result in invalid JSON being added to crash reports.

Run full E2E CI

@github-actions
Copy link

github-actions bot commented Jun 21, 2021

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size increased by 1,360 bytes from 1,128,680 to 1,130,040

Generated by 🚫 Danger

@nickdowell nickdowell changed the title [PLAT-6798] Improve breadcrumbs performance [PLAT-6798] Improve performance of leaving breadcrumbs by using async file I/O Jun 21, 2021
@nickdowell nickdowell changed the title [PLAT-6798] Improve performance of leaving breadcrumbs by using async file I/O [PLAT-6798] Improve breadcrumbs performance with async file I/O Jun 21, 2021
@nickdowell nickdowell marked this pull request as ready for review June 21, 2021 10:20
@nickdowell nickdowell merged commit bf9719a into next Jun 24, 2021
@nickdowell nickdowell deleted the nickdowell/async-breadcrumbs branch June 24, 2021 10:19
@nickdowell nickdowell mentioned this pull request Jun 30, 2021
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