-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Replace ConcurrentQueue<T> in BackgroundWorker #3355
Conversation
…y/sentry-dotnet into fix/concurrentqueue-memory-leak
…y/sentry-dotnet into fix/concurrentqueue-memory-leak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me except for the tests that are a bit sparse. I've added som suggestions although they're not exhaustive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for the unrelated sentry-cocoa change.
Also, should we change breadcrumbs too in a followup PR? That's the only other place we use concurent queue in (other than tests)
Can we release this asap? |
Resolves #2516
That issue has quite a few messages in the history but see here for what finally gave rise to this PR:
Memory profile
Before this PR
After this PR
Performance
I was a worried about performance using a bespoke concurrent queue but we seem to have pretty comparable performance to
ConcurrentQueue<T>
in our specific use case (a bit better in fact).I tried a few different variations of the code (using a
LinkedList<T>
andQueue<T>
for the internal queue) bit plain oldList<T>
turned out to be the fastest by quite a margin (and use the least memory).