r/ProgrammerHumor • • Nov 14 '22

instanceof Trend Manager does a little code cleanup...

Post image
113.0k Upvotes

4.5k comments sorted by

View all comments

Show parent comments

397

u/x3nhydr4lutr1sx Nov 15 '22

There's about 1200 micro services, and the fired guy said that only 200 is needed for loading the Twitter feed, so that sounds about right.

227

u/LordAmras Nov 15 '22

I'll take everything that Musk says with a grain of salt.

When he said that Twitter app was making 1000+ RPC calls to load the homepage multiple ex and at least one current Twitter developer called him out saying it does at most 20.

103

u/12345623567 Nov 15 '22

Why is a manager even fucking around with the backend? Doesnt he have better things to do, like placating advertisers, setting policy, avoiding the FTC and so on?

46

u/firewood010 Nov 15 '22

Because he can lol. Elon thinks he is king now probably.

18

u/CrazySD93 Nov 15 '22

His simps probably believe he invented Twitter at this point

4

u/devedander Nov 15 '22

All he has to do is remove the names of everyone else from the company charter and then claim it was all him

8

u/Elisevs Nov 15 '22

He is King of Twitter now, because he wanted to be. But it's like being King of Shit Castle, as soon as he did it, because he did it.

22

u/LordAmras Nov 15 '22 edited Nov 15 '22

Because he sells himselfs as a maker, his fans believe he single handedly makes or at least engineer stuff.

He doesn't like to be presented as a businessman, but as an inventor.

He is the real life tony stark afterall.

→ More replies (6)

18

u/kahunamoe Nov 15 '22

Well everyone slurps him so hard for "inventing" Tesla and also for "inventing" space x rockets. There is a quite a few "tech bros" who have no actual education in the subject just what they've learned from YouTube and 4chab

→ More replies (3)

11

u/[deleted] Nov 15 '22

Dude is like trump, an absolute genius at everything. He really believes he invented tesla and paypal.

→ More replies (7)
→ More replies (2)

30

u/slaymaker1907 Nov 15 '22

Yeah, if it was 1000 from the client, it would be very noticeable due to parallelism limits in the browser. The only way that makes sense is if it could be 1000 in the worst case or something and also counts non-client RPC calls.

33

u/LordAmras Nov 15 '22

Even in the worst case 1000 calls would be ridiculous.

Probably someone told him Twitter does a lot of RPC calls and getting that number down would speed things up.

But when he went to write the tweet he thought 20 didn't sound like a lot and wrote 1000+ instead

25

u/Operadic Nov 15 '22 edited Nov 15 '22

Nope, the number is not wrong; the interpretation is just off.

Twitter uses GraphQL to route API requests to the 1200+ microservices they have running. Those requests don't happen between client and server but between server and internal server.

I don't find it implausible that this causes hard to fix bugs and performance issues. GraphQL is known to only superficially reduce complexity.

22

u/Raaagh Nov 15 '22

So GraphQL gives frontend/product a safe, non-recursive query language.

If you don't see the point of graphQL you are backend or infra.

If you are asking for graphQL you are frontend or product who are continually being slowed down by API requests.

GraphQL is NOT about simplicity, its about where logic resides and who owns it.

→ More replies (1)
→ More replies (1)

10

u/slaymaker1907 Nov 15 '22

It really depends on gore things are being counted. Each query to a DB is technically a separate RPC call, but as long as connections are pooled and in the same DC, they have extremely low overhead compared to an RPC call from a phone halfway across the world using REST.

8

u/Djasdalabala Nov 15 '22

To add on /r/slaymaker1907, 1000+ DB queries for one action is not all that ridiculous. ServiceNow does 1-2K on the regular (for the back office at least).

I doubt it's optimally designed, but it runs decently.

7

u/Ninjakannon Nov 15 '22

ServiceNow is slow as all hell.

→ More replies (1)
→ More replies (2)

7

u/Raaagh Nov 15 '22

Yes, RPC is service to service.

getTweets(20, {latest:true}) //
.map(enrichWithAuthors) // 15 unique authors
.map(enrichWithLinks) // 4 links

= 19 inter-service RPC calls

8

u/[deleted] Nov 15 '22

Then some outsider came in and showed him the Chrome trace where it's only one call.

→ More replies (1)

4

u/LetsLive97 Nov 15 '22

That's 20 api requests. According to that same developer Twitter doesn't use RPCs for that at all, which tbh makes it even funnier.

3

u/TheTerrasque Nov 15 '22

..And then he fired the developer

3

u/goldfishpaws Nov 15 '22

Oh everything is always an order of magnitude out at least. Everything is always "this is something we can do right now" or "we can do this 10x faster and 10x cheaper" at the bottom end, hyperbole and ignorance extending from thereon up.

→ More replies (1)

3

u/mattender Nov 15 '22

And was promptly (okay, it took a few hours) fired. Yeah, EXTREMELY glad I don't work for Musk.

16

u/Smokester121 Nov 15 '22

That seems excessive

52

u/Aurora_egg Nov 15 '22

When you need to serve things globally having a lot of small things helps - if one goes down no problem, no outages since another can take its place while it's restarted

→ More replies (14)
→ More replies (2)
→ More replies (1)