firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.26k stars 572 forks source link

Improve cold initialization time #5986

Closed mrober closed 4 months ago

mrober commented 4 months ago

Improve cold initialization time by not validating the fid on init. We only need to detect if the fid has changed on initialization, we don't care if it's valid. Changing it, deleting it, manipulating it, whatever... should cause the Crashlytics id to rotate. That will still happen after this change.

In my local experiments, this improved the cold init time from about 300 ms to 50 ms. This does not affect warm init, when the fid and auth token are already cached. On the first report, if the auth token has not yet been fetched, it will get fetched at upload time. If validating the fid caused the fid to rotate, the Crashlytics id will also rotate on the next launch.

github-actions[bot] commented 4 months ago

Release note changes

The following release notes were modified. Please ensure they look correct.

Release Notes
firebase-crashlytics ```markdown ### {{crashlytics}} version 19.0.1 {: #crashlytics_v19-0-1} * {{changed}} Improve cold initialization time. * {{fixed}} Fixed version compatibility issues with other Firebase libraries. #### {{crashlytics}} Kotlin extensions version 19.0.1 {: #crashlytics-ktx_v19-0-1} The Kotlin extensions library transitively includes the updated `firebase-crashlytics` library. The Kotlin extensions library has no additional updates. ```
google-oss-bot commented 4 months ago

<!DOCTYPE html>

Coverage Report 1

Affected Products

Test Logs

mrober commented 4 months ago

4345

google-oss-bot commented 4 months ago

<!DOCTYPE html>

Size Report 1

Affected Products

Test Logs

google-oss-bot commented 4 months ago

<!DOCTYPE html>

Startup Time Report 1

Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS.

Notes

Startup Times