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

[QA] Make logging faster on startup #3793

Merged
merged 4 commits into from
Oct 16, 2024
Merged

[QA] Make logging faster on startup #3793

merged 4 commits into from
Oct 16, 2024

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Oct 15, 2024

📜 Description

  • There are some benchmarks in here comparing String.format vs plus-operator, and String.format is indeed slower.
    • Since we're doing some logging on startup (e.g. when parsing the manifest), even when debug is set to false, this was adding some overhead. I've removed the redundant log call + add changed String.format usages to the plus operator
  • We were doing unnecessary String.format even when there are no args passed, so we check for their presence now and call the method without String.format explicitly now

Before

Android Studio 2024-10-15 18 37 08

After

Android Studio 2024-10-15 18 36 10

📝 Checklist

  • I reviewed the submitted code.
  • 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.
  • 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

Copy link
Contributor

github-actions bot commented Oct 15, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 460.94 ms 500.31 ms 39.37 ms
Size 1.70 MiB 2.35 MiB 667.93 KiB

Previous results on branch: rz/fix/slow-logging

Startup times

Revision Plain With Sentry Diff
feee2f1 486.77 ms 560.46 ms 73.69 ms

App size

Revision Plain With Sentry Diff
feee2f1 1.70 MiB 2.35 MiB 667.93 KiB

@romtsn romtsn enabled auto-merge (squash) October 16, 2024 10:05
@romtsn romtsn merged commit 55ea3cc into main Oct 16, 2024
26 of 27 checks passed
@romtsn romtsn deleted the rz/fix/slow-logging branch October 16, 2024 10:14
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