Certainly if there's a lot of small methods, they could have an optimization pass that inlines some of them and bring their overall method count down. I wouldn't be surprised if that was a small performance gain, too.
I thought of that, then the pragmatic engineer in me observed that they only discovered this after cracking their app into so many small methods. Given the time choice of 1. uncracking their app into small methods (which presumably wasn't atomic, so now that's all mixed in with other development, so it's not like it can just be reverted) or 2. hacking the system to handle more methods, I am forced to admit that choic…
Dalvik patch for Facebook for Android
11–20 of 95 posts
Re: Dalvik patch for Facebook for Android
#12[deleted]
If you read TFA, they bent over backwards to attempt app-only methods... but ultimately hit a hard wall on the LinearAlloc buffer size in Android 2.x. So, off to extraordinary measures land they went.
If they had known about this hard wall in one of their target devices, before making and implementing their code design choices, would they have taken the same approach?
What they did is neat, why they did, given their journey, is understandable, how they frame what they did and how they did it is masturbatory.
Re: Dalvik patch for Facebook for Android
#13A favourite of mine is Jari Komppa's article on his process of porting Death Rally from DOS to Windows: http://sol.gfxile.net/dr_gdm.html.
Does anyone have any other articles along the same lines? I'd love to read them!
Re: Dalvik patch for Facebook for Android
#14In return, maybe you could open-source some of your app, for example?
Re: Dalvik patch for Facebook for Android
#15Re: Dalvik patch for Facebook for Android
#16It's interesting to see the parallels between Android and Windows in this regard. Here's a story from my past, copied from a blog post I wrote last year: My first job at Microsoft was providing developer support for the early Windows SDKs. To do my job well, I spent hours studying the Windows SDK documentation, the Windows source code, and writing sample applications. I then spent hours poring over customers’ (such a…
Re: Dalvik patch for Facebook for Android
#17It's interesting to see the parallels between Android and Windows in this regard. Here's a story from my past, copied from a blog post I wrote last year: My first job at Microsoft was providing developer support for the early Windows SDKs. To do my job well, I spent hours studying the Windows SDK documentation, the Windows source code, and writing sample applications. I then spent hours poring over customers’ (such a…
Re: Dalvik patch for Facebook for Android
#18Re: Dalvik patch for Facebook for Android
#19Wisdom of a three-million-method app aside, I wonder why they didn't fix this in the compilation toolchain rather than by poking around in native memory areas during app startup. Facebook wrote a PHP->C++ compiler; changing the Dalvik compiler to more aggressively inline small methods seems trivial in comparison.
Re: Dalvik patch for Facebook for Android
#20The first paragraph is just rampant self praise. Basically these engineers decided to be really clever, painted themselves into a corner, smashed a hole in the wall so as to escape from said corner, and then bragged about how great they are.