It'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…
Dalvik patch for Facebook for Android
31–40 of 95 posts
Re: Dalvik patch for Facebook for Android
#32"We were certainly glad and grateful that Android is open source—otherwise, this change wouldn’t have been possible." In return, maybe you could open-source some of your app, for example?
Re: Dalvik patch for Facebook for Android
#33"We were certainly glad and grateful that Android is open source—otherwise, this change wouldn’t have been possible." In return, maybe you could open-source some of your app, for example?
We do already open source a wide variety of projects, for those who aren't already aware: https://github.com/facebook
Re: Dalvik patch for Facebook for Android
#34Earlier quoted context omitted.
I think GP meant something like a build process that inlines the bytecode, not the source code itself. I don't see why this is unreasonable, especially compared to what they actually did.
For as nasty as the hack is, it still boils down to twiddling with a few numbers. Also, inlining is probably easier said than done. It's not enough to inline the methods, you need to make them entirely disappear, and ISTR reading within the last few days somebody else commenting that Java still has to keep the metadata about the methods around (which is the problematic part, not the methods themselves, if I'm reading…
Assuming Java has something like the Cecil library for MSIL, it should be a fairly straightforward task. Although, as you point out, so is fixing up a number.
Re: Dalvik patch for Facebook for Android
#35It'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…
For the longest time, I was convinced it was an abomination that Linux did not succeed on the desktop. Now, I am not so sure.
EDIT: or cek, Charlie Kindel :)
Re: Dalvik patch for Facebook for Android
#36According to http://techcrunch.com/2013/03/04/facebook-google-dalvik/ and http://venturebeat.com/2013/03/04/google-facebook-android/ , the specific limit being hit was a cap of three million methods per instance of the Dalvik VM. Wisdom 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 wr…
Three million methods? Having both programmed for Android and having used the Facebook App for Android, I find it very difficult to believe that app has anywhere near 3 million methods, even if each one is basically a one-liner. If the number is correct, that really is some kind of crazytown code.
Re: Dalvik patch for Facebook for Android
#37It'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…
For the longest time, I was convinced it was an abomination that Linux did not succeed on the desktop. Now, I am not so sure.
Re: Dalvik patch for Facebook for Android
#38Earlier quoted context omitted.
For as nasty as the hack is, it still boils down to twiddling with a few numbers. Also, inlining is probably easier said than done. It's not enough to inline the methods, you need to make them entirely disappear, and ISTR reading within the last few days somebody else commenting that Java still has to keep the metadata about the methods around (which is the problematic part, not the methods themselves, if I'm reading…
I'm not sure inlining is that difficult. Java bytecode is a relatively straightforward language is it not? Especially if it doesn't have to be for all cases, which, if you're looking at eliminating small methods, it does not have to be. Assuming Java has something like the Cecil library for MSIL, it should be a fairly straightforward task. Although, as you point out, so is fixing up a number.
I'm not familiar with Java compilers but I'd hazard a guess that to exploit this optimization (if it were possible at all) they would probably have to significantly rework their code.
Re: Dalvik patch for Facebook for Android
#39This. "There has to be a better solution", a quality which defines hackers - is it not? It's that pushing the boundaries for the sake of getting things done that drive progress, isn't it? It's tempting to take the easy route out. In this case they could have justified supporting devices ICS up, Gingerbread and down does not have a lot of market share I assume. But they chose to persist.
It's that persistence that we need to cultivate to become successful hackers.
Re: Dalvik patch for Facebook for Android
#40Earlier quoted context omitted.
For the longest time, I was convinced it was an abomination that Linux did not succeed on the desktop. Now, I am not so sure.
One of the advantages of open source is that things like that don't tend to happen. If a change to X breaks Y, the X maintainers don't include a horrible hack to avoid breaking it, they just submit a patch to Y. Then the package manager makes sure nobody installs new X without installing patched Y.