Ever wondered (like Simon) why the Tesla iOS app is 760 MB..? Well you're about to find out 👀 🔬 Taking a look at Tesla's app size + exploring Immediately what jumps out is that ~30% of the app is `Tesla.pck` (241.2 MB) 🧠 A .pck is a file format for bundling Godot assets (scenes, scripts, shaders, etc). Out of all the app's that we download, this is *by far* the largest .pck included in an app. This is how Tesla creates 3d model interactivity in the app. The cool thing about a .pck (& the internet) is that we can actually decompile it to see raw assets + project structure. We can even open it in Godot and see that there are models like 3D Cybertrucks. That's the Godot functionality... but how could Tesla make the app smaller? 🤔 Remember how Godot was shipping in each Plugin? There are 5 plugins in Tesla for a total of 188.3 MB. The contents of each Plugin appear to be ~nearly~ identical. We can see this pretty clearly in the diff between v4.47.0 and v4.42.0 when the app increased by 50 MB. Each plugin added the same three `SwiftModules_*.bundle` files + had similar increases in binary size. So ~190 MB (25%) of Tesla is coming from Plugins, which could be significantly reduced by using a dynamic framework. 🤓 Another area for improvement - Tesla (uses RN) has a 96.6 MB main.jsbundle, but 26.7 MB is "debug info". The debug info is meant to provide better stack traces, but it doesn't need to be in prod b/c you can provide it separately to crash reporters. A few other areas Tesla can reduce size - image optimization - removing unneeded binary metadata - minifying localizations Our full thread with a lot more details on Emerge Tools Twitter: https://lnkd.in/grE996S4 Using Dynamic Frameworks: https://lnkd.in/gSsdxcDj gdsdecomp, the Godot decompiler we used for our analysis: https://lnkd.in/g-JpjNzQ
id love to see a talk from the Tesla Android team on how they do all this stuff. Let me know if you know anyone there Josh Cohenzadeh and we can do a webcast through my SF Android GDG meetup
In most of big companies you are not incentivized to reduce a binary size. It doesn't give you a promo, it doesn't reduce user base size, so developers are focused on the most impactful things for their career.
I guess it doesn't matter because nobody cares, at least not the app providers. I guess you are aware of the increased app sizes over the years for basically identical features? 32 GB android phones are not usable today, when you do a few things on your phone. I don't know what kind of pushback has to came that they care again.
Bruno Garcia - Godot used in another interesting way.
Slightly unrelated, but I wish app stores would require the release description to be more substantive and not “This release contains minor fixes and improvements”.
At the risk of going against the trend, why should they bother - what with the storage space being cheap and all? It is a genuine question by the way :) I would love to hear author’s opinion on that.
Including the debug symbols isn't just a file size fail - it's a security issue. That means an external actor can tell how to symbolicate the app and determine it's internal logic. An attacker can definitely exploit that.
What’s extremely unfortunate is that you need this app to use many of the car features effectively so they have extremely small incentive to reduce the size. Owners will downloaded it no matter what.
Staff Software Engineer @ Tesla
3w😅 good writeup Josh Cohenzadeh