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 replay lazy and faster #3799

Merged
merged 4 commits into from
Oct 16, 2024
Merged

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Oct 16, 2024

📜 Description

  • There are some things we were eagerly initializing for replay that we actually don't need (and only use them on a bg thread, so this should be a good improvement)
  • Use Class.getName instead of Class.getCanonicalName as seems like the latter is quite a bit slower due to checks for class locality/anonymity which goes into the native layer. Maybe an outlier, but they are essentially the same thing except a couple of cases, so I think it's fine to use it here
  • Get rid of unnecessary positionInWindow call as we already get the coords via boundsInWindow anyway
  • Get rid of runInBackground init call as it wouldn't do anything because ReplayCache is null at that point anyway

Before (canonicalName change)

Screenshot 2024-10-15 at 23 39 01

After (canonicalName change)

Screenshot 2024-10-15 at 23 51 47

💚 How did you test it?

Existing tests should cover it

📝 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 16, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 446.71 ms 556.78 ms 110.06 ms
Size 1.70 MiB 2.35 MiB 667.98 KiB

Previous results on branch: rz/fix/slow-replay-main-thread

Startup times

Revision Plain With Sentry Diff
0bd8123 447.78 ms 452.78 ms 5.00 ms

App size

Revision Plain With Sentry Diff
0bd8123 1.70 MiB 2.35 MiB 667.98 KiB

@romtsn romtsn enabled auto-merge (squash) October 16, 2024 22:21
@romtsn romtsn merged commit ee6ab95 into main Oct 16, 2024
26 of 27 checks passed
@romtsn romtsn deleted the rz/fix/slow-replay-main-thread branch October 16, 2024 22:26
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