Live data from Hacker News

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

engineering.fb.com

241–250 of 333 posts

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

#242

Earlier quoted context omitted.

it seem you don't have experience on large scale apps... and the people that make these type of comments almost never have had to work on large applications..... Spotify had about 500k, lines of code in 2015, (not including external libraries). We did make it in a feature based architecture, where there was a main container app (and a major core playback library) and for every major feature they had their own sub-pro…

I would love to read more about why large apps are so big. I currently work on a project that is much larger than I would expect it to be, both in terms of codebase and people, and while I don't know who to jank, I also don't understand why it has to be so big.

Short answer: because it's way more feasible to remodel your kitchen than to tear down your entire house and rebuild it.

And then your bathroom. And then convert the garage. And then add an addition. And in 10 years you have this cobbled-together monstrosity

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

#243

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?

Messenger was never written in React Native https://reactnative.dev/showcase

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

#244
post #53

It'll suck for the SEO team at LightSpeed point of sale company. FB named a open source project the same name as a company.

I feel worse for Lightspeed web server software. Who I'm sure are after some of the search terms mentioned in this post.

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

#245
post #166

Earlier quoted context omitted.

i use telegram web and it is awesome. Messenger web just sucks, i don't why actually, maybe it is because of the design. I have not checked the others (signal, wechat). tl;dr web clients are probably more performant than their electron counterpart

I mentioned Telegram because the desktop version does not use electron. It's a QT application and is small and fast.

It doesn't look like, though. I refused to use the desktop Telegram for long because it looked like just another Electron app, until one day a friend enlightened me that it's actually a lean(er) QT app.

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

#246
post #219
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

From TFA: "We reduced core Messenger code by 84 percent, from more than 1.7M lines to 360,000." Sounds like not only did they make the app quicker and lighter, they improved code maintenance too. If the android app is as the same size as the new ios messenger app, they'd still have less code to maintain than the previous ios messenger app. See also: this other comment - https://news.ycombinator.com/item?id=22468036

How in the name of everything did they manage to write 1.7M lines of code for a messenger app? That is an astonishingly large code base! We're talking about an instant messenger app with heaps of features, having a LoC footprint 3.5% of the size of modern Windows.

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

#247
post #85

So, they've reduced 1.7M lines of code to 360K. Let's pause here for a moment: - NumPy is 360K lines mostly C - Postgres is around 2.1M of C - Go 1.13 is around 1.5M of Go code - Rust 1.37 is around 1.2M of Rust code iirc - core llvm is around 3M of C++ iirc ... A chat app is 1.7M. A chat app... Makes me feel sorry for all the time spent/wasted by all those devs, many of whom are unquestionably brilliant and could've…

It's a chat app that works very well even on the crappiest connections. If it having 1.7M lines of code indicates anything it is that creating a "simple app that provides simple functionality over a network well" is hard . Look at the garbage generated by Google - text messages and images on Google hangout are not guaranteed to arrive in order ( or even be sent in order ) unless you are on a great network.

You don’t need 1.7m LOC to build a simple app that works well over different network conditions.

Speaking of garbage, looks like most of the 1.7m LOC on Messenger was actually garbage, now that they’ve literally thrown most of away.

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

#248
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…

That's the problem with Coordinate descent[1], which is how we humans intuitively go about optimizing things.

[1]: https://en.wikipedia.org/wiki/Coordinate_descent

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

#249
post #219

Earlier quoted context omitted.

From TFA: "We reduced core Messenger code by 84 percent, from more than 1.7M lines to 360,000." Sounds like not only did they make the app quicker and lighter, they improved code maintenance too. If the android app is as the same size as the new ios messenger app, they'd still have less code to maintain than the previous ios messenger app. See also: this other comment - https://news.ycombinator.com/item?id=22468036

How in the name of everything did they manage to write 1.7M lines of code for a messenger app? That is an astonishingly large code base! We're talking about an instant messenger app with heaps of features, having a LoC footprint 3.5% of the size of modern Windows.

And they ended up in hundreds of thousands of lines :)

Wonder if part of this is custom video / audio codecs? That I’d imagine would contribute a good amount...

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

#250
post #219

Earlier quoted context omitted.

From TFA: "We reduced core Messenger code by 84 percent, from more than 1.7M lines to 360,000." Sounds like not only did they make the app quicker and lighter, they improved code maintenance too. If the android app is as the same size as the new ios messenger app, they'd still have less code to maintain than the previous ios messenger app. See also: this other comment - https://news.ycombinator.com/item?id=22468036

How in the name of everything did they manage to write 1.7M lines of code for a messenger app? That is an astonishingly large code base! We're talking about an instant messenger app with heaps of features, having a LoC footprint 3.5% of the size of modern Windows.

I wonder if react native library code and all the other code related to it like the js engine is included in that metrics.
Post reply on HN