Impact on app size when adding Firebase SDK

4,580 views
Skip to first unread message

Ryan Chase

unread,
Sep 21, 2016, 2:06:48 PM9/21/16
to Firebase Google Group
I am working with a client to implement Firebase within mobile native apps and they had asked what the impact on app size is when adding the Firebase SDK. Since I am not a developer I am not sure how to assess this. Can someone help me out?

Doug Stevenson

unread,
Sep 21, 2016, 4:52:51 PM9/21/16
to Firebase Google Group
Ryan, are you working on Android or iOS?

Doug

Ryan Chase

unread,
Sep 21, 2016, 11:32:43 PM9/21/16
to Firebase Google Group
Both.

Doug Stevenson

unread,
Sep 22, 2016, 2:30:57 PM9/22/16
to fireba...@googlegroups.com
I can't speak to iOS so much, but I imagine you can simply measure the size of the resulting app bundle before and after integration.

Android is more difficult.  Is your client concerned about the total APK download size, or the number of methods used that count against the DEX method count limit for apps that need to be able to target API level 20 or lower.  There are tools to help you count the number of methods in an app if that helps.

These things are general issues for all libraries you might want to add, and not unique to Firebase.  Unfortunately, there is not one true metric that I can convey, because developers who are deeply concerned about the size of an app will apply many techniques to shrink their apps even more, including the use of ProGuard.  ProGuard will do its best to remove unused code, but its benefits can only be measured on a specific app and not in a general sense.  So, if you want to understand the minimal weight of Firebase client libraries, you actually have to start using it, then apply shrinking techniques to minimize the overall size of the app.

I will say that the Firebase staff is very much concerned about the weight that Firebase libraries can add to an app, and we're actively looking for ways to minimize it.

Doug
 

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/uQQUvnLI8xc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/41e191ff-99f5-45b3-87a0-f7c3c10188c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Chase

unread,
Sep 22, 2016, 9:34:02 PM9/22/16
to Firebase Google Group
Thanks for the detailed response, Doug. My client is looking to understand the impact before adding it to their apps since they are still deciding which platform to use. In your experience is it a couple mb or a couple hundred kb? Sounds like it may be difficult to really know until after it has been added to an app due to the different ways you can reduce the size of the codebase.



On Thursday, September 22, 2016 at 11:30:57 AM UTC-7, Doug Stevenson wrote:
I can't speak to iOS so much, but I imagine you can simply measure the size of the resulting app bundle before and after integration.

Android is more difficult.  Is your client concerned about the total APK download size, or the number of methods used that count against the DEX method count limit for apps that need to be able to target API level 20 or lower.  There are tools to help you count the number of methods in an app if that helps.

These things are general issues for all libraries you might want to add, and not unique to Firebase.  Unfortunately, there is not one true metric that I can convey, because developers who are deeply concerned about the size of an app will apply many techniques to shrink their apps even more, including the use of ProGuard.  ProGuard will do its best to remove unused code, but its benefits can only be measured on a specific app and not in a general sense.  So, if you want to understand the minimal weight of Firebase client libraries, you actually have to start using it, then apply shrinking techniques to minimize the overall size of the app.

I will say that the Firebase staff is very much concerned about the weight that Firebase libraries can add to an app, and we're actively looking for ways to minimize it.

Doug
 
On Wed, Sep 21, 2016 at 3:34 PM, Ryan Chase <ry...@blastam.com> wrote:
Both.


On Wednesday, September 21, 2016 at 1:52:51 PM UTC-7, Doug Stevenson wrote:
Ryan, are you working on Android or iOS?

Doug

On Wednesday, September 21, 2016 at 11:06:48 AM UTC-7, Ryan Chase wrote:
I am working with a client to implement Firebase within mobile native apps and they had asked what the impact on app size is when adding the Firebase SDK. Since I am not a developer I am not sure how to assess this. Can someone help me out?

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/uQQUvnLI8xc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.

Gero H

unread,
Sep 23, 2016, 8:02:04 AM9/23/16
to Firebase Google Group
I can give you an example for iOS:
I quickly compared two old archives I have of my app, one before I added Firebase and one right after I added the SDK (only basic, i.e. Analytics):
83.6 MB on disk versus 91.6 MB.
Keep in mind though, that these are the *archives* for the app to send to Apple. They're standard, i.e. bitcode is enabled and so on. What the user downloads from the store is usually smaller, as they will only get the architecture they need.
IMO the size increase is neglectable, even on an iPhone with less disk space. Graphics and so forth that you include in your app easily take up much more space than this. As a matter of fact, take the concrete numbers I provide here with a grain of salt. While Firebase was the biggest addition I did between those two archives, I also added a few images (in the KB range) and wrote more code, obviously.
And just in case, since you said you're not a developer yourself: Keep in mind this is storage space, not memory footprint! From what I've seen during development, what is actually loaded into memory by analytics is really little. My app took up about 30 to 35 MB of memory before and I couldn't see Firebase adding much to that (I haven't analyized this, though).

Doug Stevenson

unread,
Sep 23, 2016, 6:32:26 PM9/23/16
to fireba...@googlegroups.com
Ryan, as a data point, the addition of the firebase-core dependency (version 9.6.0) to a skeleton project adds about 300KB to the overall weight of the final APK, with no Proguard shrinking.  This dependency is used by every Firebase features and includes Analytics.  As you include other Firebase features, such as Realtime Database or Storage, you'll incur additional weight:

Including firebase-database adds another ~200KB.
Including firebase-storage adds another ~100KB.

So, to answer your questions, you're looking at hundreds of KB rather than megabytes.

Doug


To unsubscribe from this group and all its topics, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages