Live data from Hacker News

Dalvik patch for Facebook for Android

facebook.com

71–80 of 95 posts

Re: Dalvik patch for Facebook for Android

#71

Uninstalled. I checked, and Facebook took up more memory than any other application I have installed, even more than TSF Shell. (By the way, a MUCH more "feature-rich," useful, and snappy app than facebook!) Facebook isn't doing anything comparable to what TSF Shell does, not for me anyway. I bet this is why my phone recently started taking 30 seconds to make a phonecall (!). I can't believe an app requires 8M RAM ju…

The only reason to root my old HTC Desire that I still use happily was to be able to uninstall Facebook, Weather, Twitter and a few more apps I didn't need. Needless to say, the phone suddenly felt much snappier and my battery life doubled.

Re: Dalvik patch for Facebook for Android

#72

Earlier quoted context omitted.

Came here to opine on the exact same topic! I was going to dig up some Raymond Chen blog entries but your CreateFont example illustrates it equally well. I guess hacks are inevitable when you are dealing with that kind of scale/complexity.

It's less of a scale issue and more of an ease of update issue. Back in the days someone who bought a copy of Windows would take it home, and if it broke some existing software they used, they were going to blame the OS and return it to the store (they surely are not returning WordPerfect or Adobe product that they bought eons ago). Having always-connected clients and ability to force-update the code changes the game…

Windows Vista shipped with around 6000 fixes for applications, ranging from "this is a game, add it to the Games Explorer", over "report the Windows version as XP because they broke their checks" to "let HeapAlloc allocate a few more bytes each time because they overrun a buffer at some point". The nice thing about those shims is that you don't have to sully your API design with individual hacks and fixes for dozens, hundreds or thousands of applications. You just enable certain behaviour externally which then replaces the API function by a wrapper (or another function entirely) for that process.

This list usually only grows longer (and includes older versions of MS' own software too). There's also plenty of software where the vendor isn't around anymore which is still widely used. You can't just tell them to fix their code because they don't exist anymore. Raymond Chen oftentimes has to argue that part and given that he worked on application compatibility on Windows for quite some time I'm inclined to believe him.

Re: Dalvik patch for Facebook for Android

#73
post #8

The 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.

As a programmer if you feel clever, most of the time you're doing something wrong. There might be 1% of code that should or can be clever but I prefer my code to be robust.

They clearly say that "this idea seemed completely insane" so it's not like they took this road lightly. They searched for a solution and became rather desperate. I wonder if they asked Google for help.

Having said that I'm not sure I would be frank about such a crazy hack for a slow behemoth app that is only considered "fast" because the previous version was insultingly slow.

Re: Dalvik patch for Facebook for Android

#74
it's great for employees at facebook that the company allows their engineers such tinkering (to an absolute extreme in this point). but I think fb engineers should work on bigger problems than hacking the dalvik vm - like stopping the erosion of their younger user base.

Re: Dalvik patch for Facebook for Android

#75

Earlier 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.

The flip side of this is that you have to keep up with breaking changes all the time. I've developed numerous in house apps that run on linux, and it is hard to keep up with every minute details that changes in all parts of such a system. It is exceedingly hard to justify that you have to spend a day figuring out what they changed in gtk that now makes the text appear a bit different, or why the init.d script that has never had a problem now sometimes fail to stop the service etc. ISVs, at least small ones, simply cannot keep up with the frequent external changes on such platforms, and the fewer people there are developing applications, in-house, open source, proprietary or what not, less people will use that platform.

Re: Dalvik patch for Facebook for Android

#76

Earlier quoted context omitted.

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.

The flip side of this is that you have to keep up with breaking changes all the time. I've developed numerous in house apps that run on linux, and it is hard to keep up with every minute details that changes in all parts of such a system. It is exceedingly hard to justify that you have to spend a day figuring out what they changed in gtk that now makes the text appear a bit different, or why the init.d script that ha…

Why is this downvoted? It voices an honest concern! Linux has often been compared to living in a house full of carpenters, where your bed might disappear at night while you sleep.

If this observation is incorrect, write a comment so the rest of us can understand WHY it's incorrect, if it's correct then upvote it, but there's no excuse to downvote!

Re: Dalvik patch for Facebook for Android

#77

"choose between cutting significant features from the app or only shipping our new version to the newest Android phones (ICS and up)" The ICS move wouldn't have been a bad option. It would've helped a lot of users convert to ICS+ devices, which Google probably would've loved. The APIs from 4+ are much more robust than pre-ICS, and it probably would've saved more headaches while building the new version in addition to…

Android 2.2 and 2.3 devices are still being released on low end phones, especially in developing countries, so the number of pre-ICS users are actually growing, not shrinking.

Bought one a year ago (2.3.3, I think). It's a Wildfire S, very small and lightweight, has a web browser. Can make calls and probably can send short messages. I was using Windows Mobile 2003 before that and thought I was finally on the "bleeding edge" of mobile technology, only to find out a month later that Android 2.3 is considered "legacy" and they are talking about not supporting it? What, are we supposed to buy new phones every five years now?

Re: Dalvik patch for Facebook for Android

#78

According 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.

I bet that having so many methods makes it impossible for them to reuse their methods, probably they have a shitload of repetition in there. I just can't stop laughing about these arrogant people, and the balls to think that no other developers have had their challenges. Must be hell working in that place.

Re: Dalvik patch for Facebook for Android

#79
post #20
post #8

The 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.

Hitting an arbitrary (and undocumented?) platform limit on the number of methods your app is allowed to have is hardly "painting themselves into a corner".

I'm not sure if it is listed in the official documentation but it was talked about by the Android team on their blog:

http://android-developers.blogspot.com/2011/07/custom-class-...

Re: Dalvik patch for Facebook for Android

#80

Earlier quoted context omitted.

Android 2.2 and 2.3 devices are still being released on low end phones, especially in developing countries, so the number of pre-ICS users are actually growing, not shrinking.

Bought one a year ago (2.3.3, I think). It's a Wildfire S, very small and lightweight, has a web browser. Can make calls and probably can send short messages. I was using Windows Mobile 2003 before that and thought I was finally on the "bleeding edge" of mobile technology, only to find out a month later that Android 2.3 is considered "legacy" and they are talking about not supporting it? What, are we supposed to buy…

  are we supposed to buy new phones every five years now?
No. Every two.
Post reply on HN