Hacker News new | ask | show | jobs
by rty32 601 days ago
Very naive take.

1. 10% performance improvement at Instagram could lead to many millions of revenue "instantly". It is not laughable at any company. 2. It won't be a 5000% performance improvement. Facebook uses its own fork of Python that is heavily optimized. Probably still far from C++, but you should be thinking about languages like Java when talking about performance.

"Better" is a very subjective term when discussing languages, and I hope such discussions can be more productive and meaningful.

2 comments

Cinder's benchmarks don't seem "like Java" performance, given they aren't that far off cython.

https://github.com/facebookincubator/cinder/blob/cinder/3.8/...

CPython itself has seen lots of performance improvements recently. Benchmarks on CPython 3.12 take about half the time they took on CPython 3.9.
Yeah it's definitely welcome, but even if it is double the performance (doesn't seem to be quite there in my experience) fast languages are still 25-50x faster. It's like walking twice as fast when the alternative is driving.
Yes.

Well, it really depends on whether that alternative is open to you, and at what cost.

So eg lots of machine learning code is held together by duct tape and Python. Most of the heavy lifting is done by Python modules implemented in (faster) non-Python languages.

The parts that remain in Python could potentially be sped up by migrating them, too. But that migration would likely not do too much for the overall performance, but still be pretty expensive to do (in terms of engineering effort).

For organisations in these kinds of situations, it makes a lot of sense to hope for / contribute to a faster Python. Especially if it's a drop-in replacement (like Python 3.12 is for 3.9).

What makes really me hopefully is actually JavaScript: on the face of it, JavaScript is actually about the worst language to have a fast implementation. But thanks to advances in clever compiler and interpreter techniques, JavaScript is one of the decently fast languages these days. Especially if you are willing to work in a restricted subset of the language for substantial parts of your code.

I'm hoping Python can benefit from similar efforts. Especially since they don't need to re-invent the wheel, but can learn from the earlier and ongoing JavaScript efforts.

(I myself made some tiny efforts for CPython performance and correctness. Some of them were even accepted into their repository.)

> Facebook uses its own fork of Python that is heavily optimized.

So likely the 5000% improvement is no longer possible because they already did multiple 10% improvements? I don't know how this counters the original point.

All clues point to FB going this route because they had too much code already in PHP, and not because the performance improvement would be small.

In any case, "facebook does it" is not a good argument that something is the right thing to do. Might be, might not be. FB isn't above wrong decisions. Else we should buy "real estate" in the metaverse.