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

[APMAnalytics load] and [GTMSessionUploadFetcher load] take too much time at app startup #6936

Closed
shanksGuo opened this issue Nov 10, 2020 · 7 comments

Comments

@shanksGuo
Copy link

shanksGuo commented Nov 10, 2020

Feature proposal

  • Firebase Component: APMAnalytics, GTMSessionUploadFetcher

I found [APMAnalytics load] and [GTMSessionUploadFetcher load] method take long time to execute, in my case, when app launches, [APMAnalytics load] takes 51ms and [GTMSessionUploadFetcher load] takes 95ms. see the pic below. I wish you can remove +load method considering Apple is not recommend +load.
By the way, there were too many +load method in firebase and related sdk, such as #6902 #6855 , I wonder if it is possible remove all +load to keep code in control
Screen Shot 2020-11-10 at 10 31 43
Screen Shot 2020-11-10 at 11 09 33

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@shanksGuo shanksGuo changed the title Remove [APMAnalytics load] and [GTMSessionUploader load] Remove [APMAnalytics load] and [GTMSessionUploadFetcher load] Nov 10, 2020
@maksymmalyhin
Copy link
Contributor

@shanksGuo Thank you for the report. Appreciate your time spent detailed investigation!

As for +load methods usage by Firebase: for most of the cases the method Firebase classes implement it to register an SDK dependency with the Firebase component system. Completely removing the code from +load methods would make Firebase initialization much more involving process for developers. I think instead we should:
1.concentrate on moving any unnecessary and slow operation (like ones in the issues) out of the +load method
2. Set up startup testing on CI to prevent regressions in the future.

We will work on these items. Sorry for troubles.

@maksymmalyhin maksymmalyhin changed the title Remove [APMAnalytics load] and [GTMSessionUploadFetcher load] [APMAnalytics load] and [GTMSessionUploadFetcher load] take too much time at app startup Nov 12, 2020
@maksymmalyhin
Copy link
Contributor

I updated the title to better represent the issue and intended action items.

@maksymmalyhin
Copy link
Contributor

Analytics part is tracked internally at b/173110496.

@shanksGuo
Copy link
Author

@maksymmalyhin Thanks for your efforts, and I wonder which release version will these items be merged?

@maksymmalyhin
Copy link
Contributor

@shanksGuo Sorry for the delayed response. The GTMSessionUploadFetcher issue should be fixed by google/gtm-session-fetcher#219. It can be tested from the branch - add the following line to the Podfile:

pod 'GTMSessionFetcher', :git=>'https://github.com/maksymmalyhin/gtm-session-fetcher.git', :branch=>'mm/load-optimization'

The Analytics issue fix is still in progress. @htcgh may provide more detailed update on it.

@htcgh
Copy link
Member

htcgh commented Jan 5, 2021

Sorry for the late response. The Analytics fix was included in Firebase 7.2.0.

@htcgh htcgh closed this as completed Jan 5, 2021
@firebase firebase locked and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants