Skip to content

perf(core): [SDK Overhead Reduction 12] Avoid cloning Date getters#5603

Merged
adinauer merged 4 commits into
perf/sdk-overhead-reductionfrom
perf/sdk-overhead-reduction-date-getters
Jun 25, 2026
Merged

perf(core): [SDK Overhead Reduction 12] Avoid cloning Date getters#5603
adinauer merged 4 commits into
perf/sdk-overhead-reductionfrom
perf/sdk-overhead-reduction-date-getters

Conversation

@adinauer

@adinauer adinauer commented Jun 23, 2026

Copy link
Copy Markdown
Member

PR Stack (SDK Overhead Reduction)


📜 Description

Avoid cloning mutable Date values from SDK data model getters. These getters now return the stored Date reference directly, matching the broader SDK behavior of exposing mutable model data through getters.

💡 Motivation and Context

The SDK already returns mutable internals for many model fields, including maps, lists, arrays, and Device.timezone. Cloning Date values on every getter call adds allocation overhead without providing consistent immutability across the SDK data model surface.

💚 How did you test it?

  • ./gradlew :sentry:test --tests io.sentry.BreadcrumbTest --tests io.sentry.SentryEventTest --tests io.sentry.protocol.AppTest --tests io.sentry.protocol.DeviceTest --tests io.sentry.protocol.SessionSerializationTest --tests io.sentry.SessionAdapterTest
  • ./gradlew spotlessApply apiDump

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

@sentry

sentry Bot commented Jun 23, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.45.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 383.83 ms 449.42 ms 65.59 ms
Size 0 B 0 B 0 B

Baseline results on branch: perf/sdk-overhead-reduction

Startup times

Revision Plain With Sentry Diff
57376d3 309.80 ms 368.60 ms 58.80 ms

App size

Revision Plain With Sentry Diff
57376d3 0 B 0 B 0 B

Previous results on branch: perf/sdk-overhead-reduction-date-getters

Startup times

Revision Plain With Sentry Diff
a22d80d 318.35 ms 376.12 ms 57.77 ms

App size

Revision Plain With Sentry Diff
a22d80d 0 B 0 B 0 B

@adinauer

Copy link
Copy Markdown
Member Author

Cursor review

@adinauer

Copy link
Copy Markdown
Member Author

@sentry review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2b933d6. Configure here.

@adinauer adinauer marked this pull request as ready for review June 24, 2026 08:10

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me!

@adinauer adinauer merged commit 7ae0823 into perf/sdk-overhead-reduction Jun 25, 2026
21 of 56 checks passed
@adinauer adinauer deleted the perf/sdk-overhead-reduction-date-getters branch June 25, 2026 12:08
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.

3 participants