Merged
Conversation
lcian
commented
Mar 10, 2025
lcian
commented
Mar 10, 2025
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 9b49778 | 394.02 ms | 455.04 ms | 61.02 ms |
| 805cbe5 | 411.64 ms | 526.35 ms | 114.71 ms |
| ac1dee2 | 391.74 ms | 412.60 ms | 20.86 ms |
| beceaa2 | 410.46 ms | 451.02 ms | 40.56 ms |
| ed84ad9 | 386.57 ms | 392.58 ms | 6.02 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 9b49778 | 1.58 MiB | 2.21 MiB | 642.11 KiB |
| 805cbe5 | 1.58 MiB | 2.21 MiB | 642.07 KiB |
| ac1dee2 | 1.58 MiB | 2.21 MiB | 642.34 KiB |
| beceaa2 | 1.58 MiB | 2.21 MiB | 642.11 KiB |
| ed84ad9 | 1.58 MiB | 2.21 MiB | 642.35 KiB |
SentryTracer.childrenCopyOnWriteArrayList
Member
Author
|
Only found another occurrence where we are misusing |
lcian
commented
Mar 10, 2025
adinauer
reviewed
Mar 11, 2025
acbfe6f to
04c2e16
Compare
a803296 to
71e9529
Compare
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
Contributor
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Fix misuses of `CopyOnWriteArrayList` ([#4247](https://github.com/getsentry/sentry-java/pull/4247))If none of the above apply, you can opt out of this check by adding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
CopyOnWriteArrayListallows us to access its elements without copying and without the possibility to cause aConcurrentModificationException.This PR modifies its usages so that we avoid copying in order to get better performance memory-wise.
We also make sure that we are using it correctly to avoid other issues (using the iterator to avoid a possible NPE that could happen with index-based accesses, and other cases where we do things that are not thread safe).
💡 Motivation and Context
Closes #2815
💚 How did you test it?
Tested as documented in #2815 (comment)
📝 Checklist
sendDefaultPIIis enabled.