Live data from Hacker News

LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

engineering.fb.com

201–210 of 333 posts

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#201

I feel like I had an aneurysm reading this. For 6 paragraphs the repeat that they shrunk the lines of code down, that the rewrote the whole thing and that it’s a massive undertaking and that a message app should be small. 6 paragraphs of that slightly reworded and I just gave up. I honestly think this was written by a bot.

Also just LOOK at this empty state.

12 buttons. And that’s apparently stripped down. Yikes.

https://imgur.com/gallery/drOgDwF

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#202
"We started with the premise that Messenger needed to be a simple, lightweight utility. Some apps are immersive (video streaming, gaming); people spend hours using them. Those apps take up a lot of storage space, battery time, etc., and the trade-off makes sense. But messages are just tiny snippets of text that take less than a second to send. Fundamentally, a messaging app should be one of the smallest, lightest-weight apps on your phone. With that principle in mind, we began looking at the right way to make our iOS app significantly smaller."

This paragraph just restored my faith in developer sanity.

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#203
post #76

The loop of app building: 1. Build app with native framework. 2. Re-build app with some alternative framework which is slower, but let's you deploy single code on all platforms. 3. Re-build app with native framework, because it is faster. 4. GOTO 2

The best part about this cycle is that developers can always point to some metric which shows improvement to justify their actions, resulting in an Escher-like loop where they think they’re always going up. These cycles pop up all the time in development as priorities shift (or as developers find more excuses to “fix” what isn’t broken). Real world coding always involves compromise - leadership is recognizing which c…

To be fair, small fast messenger 2020 is "better" (aka more features / millisecond of cold start) than small fast messenger 2016. The cycle doesn't always go up monotonically, even if developers pretend it does. But it is possible to go "full-circle" through the loop and wind up in a better place than you started, and it's even possible for each stage of the loop to be truly justified given product needs.

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#204

Earlier quoted context omitted.

Repeating a point without adding proof doesn't make your point more valid. When people say "code wins arguments", they're referring to using source code to prove something , not "it wins because it has more source code" (???).

People say "Code wins arguments" because written code that works demonstrates the winning argument against the code that is either not written or does not work. FB messenger exists and works on crappy connections. Google hangout exists and messes up on crappy connections. Telegram exists and messes up on crappy connections ( see the issues it has in Africa ). Signal exists and does not work well even on non-crappy co…

> written code that works demonstrates the winning argument against the code that is either not written or does not work.

That's why your comment is nonsensical, if not downright contradictory noise.

> Ordering messages and providing reliability does not require 1.7M lines of code.

This has been demonstrated ad nauseum a priori with loads of toy chat apps that reconnect and retain state. It's not really a challenge. EVERYTHING else crammed into it, should be the reasoning for 1.7M lines of code, but as they demonstrated TO THEMSELVES AND EVERYONE, it wasn't (360k now)

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#205

Earlier quoted context omitted.

They make it sound like the clouds parted and a ray of sunshine struck the programmers at Facebook and they realized that they didn't have to ride the framework-go-round to hell. These are supposed to be the smartest people in SV, but from the outside, it strikes me more as a "No shit, Sherlock" moment.

Which, for example, gets you more sway with your employer, personal "branding" value, and future income / ease of switching jobs: "I was instrumental in inventing React" versus "I was instrumental in realizing we didn't need to invent React"?

"I was instrumental in a major rewrite for [REASONS]" vs "We kept it the way it was because it was good enough and a rewrite would've improved [X] but hurt [Y]"

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#207

Earlier quoted context omitted.

People say "Code wins arguments" because written code that works demonstrates the winning argument against the code that is either not written or does not work. FB messenger exists and works on crappy connections. Google hangout exists and messes up on crappy connections. Telegram exists and messes up on crappy connections ( see the issues it has in Africa ). Signal exists and does not work well even on non-crappy co…

> written code that works demonstrates the winning argument against the code that is either not written or does not work. That's why your comment is nonsensical, if not downright contradictory noise. > Ordering messages and providing reliability does not require 1.7M lines of code. This has been demonstrated ad nauseum a priori with loads of toy chat apps that reconnect and retain state. It's not really a challenge.…

> This has been demonstrated ad nauseum a priori with loads of toy chat apps that reconnect and retain state. It's not really a challenge. EVERYTHING else crammed into it, should be the reasoning for 1.7M lines of code, but as they demonstrated TO THEMSELVES AND EVERYONE, it wasn't (360k now)

Yes and they figured out what was needed after first writing a 1.7M line of code thing that worked. That's the process of reiteration and a process of initial LOC bloat before LOC stripping.

Without that process by thinking it has all been demonstrated ad nauseum a priori with loads of toy chat apps that reconnect and retain state you end up with deciding that if Friday was Feb 28th then Monday is certainly March 3rd because date/time handling is simple and end up being Robinhood, down for a day.

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#208
post #145

Earlier quoted context omitted.

> I've been using chat apps at least since ICQ (1996) and sometimes I feel the user experience has declined. You never used ICQ over a spotty 3G connection, though, did you?

I have, with an OpenVPN-over-UDP tunnel as a workaround. If they included Wireguard (or better yet, just used encrypted UDP) it would still be smaller (and probably more reliable).

Introduce random dropouts, crazy jitter and random IP switches and you get the emulation of what a crappy network looks like.

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#209
post #39

From: https://engineering.fb.com/data-infrastructure/messenger/ > We accomplished this by using the native OS wherever possible Does this mean this application does not use React Native?

Yeah, that's how I am reading that. Given the headaches caused by Apple finally barring UIWebView (the basis of frameworks like Cordova) from new App Store submissions beginning in April, I'm not surprised FB would do this. There is plenty of rumor-mongering that Apple is going to make it increasingly difficult for apps based on hybrid frameworks through the submission process.

React-native does not run in a webview. The JS binds directly to native elements. In fact, you can easily wrap any native code and make JS bindings to call it directly.

Re: LightSpeed: Rewriting Messenger’s codebase for a faster, smaller, simpler app

#210
post #93
post #84

Earlier quoted context omitted.

I just listened to the Changelog's (a podcast) episode with Richard Hipp, the author of SQLite -- I wonder if he had any part on this extension. But in any case, great to see SQLite thrive.

I did not. This is the first I've heard of it.

Wow! Awesome that you chimed in here. Thanks for some great talks on YouTube and SQLite, of course.
Post reply on HN