Skip to content

Conversation

@stefanosiano
Copy link
Member

📜 Description

added lazy class available check to LoadClass
lazy checking available classes in:

  • ActivityFramesTracker
  • AndroidViewGestureTargetLocator
  • UserInteractionIntegration

💡 Motivation and Context

Checking if a class exists uses reflection, which can be slow especially during app startup. Deferring some calls, we can improve SDK init time

💚 How did you test it?

📝 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

lazy checking available classes in:
* ActivityFramesTracker
* AndroidViewGestureTargetLocator
* UserInteractionIntegration
@github-actions
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 371.35 ms 410.53 ms 39.18 ms
Size 1.58 MiB 2.12 MiB 549.60 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b3d8889 420.46 ms 453.71 ms 33.26 ms
ee747ae 386.94 ms 431.43 ms 44.49 ms
ee747ae 400.46 ms 423.61 ms 23.15 ms
9fbb112 361.43 ms 427.57 ms 66.14 ms
cf708bd 408.35 ms 458.98 ms 50.63 ms
ee747ae 396.82 ms 441.67 ms 44.86 ms
cf708bd 434.73 ms 502.96 ms 68.22 ms
bdbe1f4 380.66 ms 464.44 ms 83.78 ms
806307f 357.85 ms 424.64 ms 66.79 ms
f634d01 375.06 ms 420.04 ms 44.98 ms

App size

Revision Plain With Sentry Diff
b3d8889 1.58 MiB 2.10 MiB 535.07 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
9fbb112 1.58 MiB 2.11 MiB 539.18 KiB
cf708bd 1.58 MiB 2.11 MiB 539.71 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
cf708bd 1.58 MiB 2.11 MiB 539.71 KiB
bdbe1f4 1.58 MiB 2.11 MiB 538.88 KiB
806307f 1.58 MiB 2.10 MiB 533.42 KiB
f634d01 1.58 MiB 2.10 MiB 533.40 KiB

@stefanosiano
Copy link
Member Author

Performance gains in release builds for init():
High end device: negligible - around ~0.2 ms
Low end device: low - around ~3 ms

@stefanosiano stefanosiano marked this pull request as ready for review October 21, 2025 15:27
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.

1 participant