News for hackers. Stuff that matters.
Re:Back end of Meta Threads is built with Python 3.10 with s... by shortrounddev2 on Thursday July 06, 2023 @01:58PM (#36620109)
Quite often, the choice of language is failing to see the forest for the trees. Saving nanoseconds or cycles because you chose C++ over Python pales in comparison to milliseconds spent at network barriers reading from a cache service or database
Re:Back end of Meta Threads is built with Python 3.10 with s... by yeck on Thursday July 06, 2023 @02:09PM (#36620317)
Perceivable latency isn't the only consideration. Depending on your business, compute for your proprietary workloads might be one of your biggest expenses. You could see an order of magnitude improvement to resource consumption depending on the type of workload and the language it is written in.

Ultimately these these choices are all about trade-offs. Maybe python is fine for them, maybe they've built themselves into a corner. Time will tell.

Re:Back end of Meta Threads is built with Python 3.10 with s... by MengerSponge on Thursday July 06, 2023 @04:25PM (#36622343)
When they need a full re-write the specification will be easy: they've already got the pseudocode. (I kid because I love Python)
Re:Back end of Meta Threads is built with Python 3.10 with s... by throwawaymaths on Thursday July 06, 2023 @02:43PM (#36620823)
At Facebook scale those nanoseconds are worth millions in compyte, energy, etc.
Re:Back end of Meta Threads is built with Python 3.10 with s... by shortrounddev2 on Friday July 07, 2023 @06:21PM (#36639046)
But do the millions you spend a year on compute cost more or less than the millions you would spend a year in labor finding the increasingly rare breed of C++ developers who can optimize things for instruction or cycle count? Such developers usually have over a decade of experience (if not multiple decades). Python developers are a dime a dozen, comparatively

Plus, instruction and cycle counting is low hanging fruit compared to memory latency. You can cache-optimize a program in any language so long as the memory representation of some data is relatively transparent.

Re:Back end of Meta Threads is built with Python 3.10 with s... by pdimitar on Friday July 07, 2023 @08:03PM (#36639873)
> But do the millions you spend a year on compute cost more or less than the millions you would spend a year in labor finding the increasingly rare breed of C++ developers who can optimize things for instruction or cycle count?

That's a very valid question but in the case of Facebook they already have them so why not use them for that?

I mean yeah, they made their choice -- use HHVM and it likely served them very well. I am just pointing out that in their case sourcing extra (or even any at all) C++ devs is a non-issue because they already have plenty.

Fully agreed with your memory latency remark.

Re:Back end of Meta Threads is built with Python 3.10 with s... by IshKebab on Thursday July 06, 2023 @05:46PM (#36623538)
The difference between C++ and Python is not nanoseconds.

And I have definitely seen projects fail due - in part - to language choice. Of course projects can succeed in almost any language but that doesn't mean the language choice is irrelevant.

Re:Back end of Meta Threads is built with Python 3.10 with s... by nimithryn on Thursday July 06, 2023 @08:43PM (#36625463)
Example? I'm curious
Re:Back end of Meta Threads is built with Python 3.10 with s... by IshKebab on Friday July 07, 2023 @02:05AM (#36627827)
Python is generally around 50 times slower than C++. Obviously it varies massively with the benchmark but that's a good ballpark.

Just Google "python vs c++ speed" and you will find hundreds of examples (or "python vs rust speed" - Rust is essentially the same speed as C++).

Here's the first result - they got a 25x speedup:

https://towardsdatascience.com/how-fast-is-c-compared-to-pyt...

Re:Back end of Meta Threads is built with Python 3.10 with s... by redsky880 on Friday July 07, 2023 @06:36PM (#36639174)
Did you read the article and comments? The comments point out a lot of issues with the article. Sadly, I've seen this article referenced before on other discussions.
Re:Back end of Meta Threads is built with Python 3.10 with s... by pdimitar on Friday July 07, 2023 @07:28PM (#36639625)
Yes and no, I still remember the times when several Ruby on Rails apps I consulted for had 5ms DB queries and Rails' ActiveRecord was taking 120ms.

Technically choosing C++ over Python will save you several orders of magnitude more than nanoseconds.

Though C++ might be a bad example. I'd replace Python web app with Elixir or Golang.