3 ms·
Copying from an older comment of mine shilling Pypy https://news.ycombinator.com/item?id=25595590 https://news.ycombinator.com/item?id=25595590 PyPy is pretty
by ghj 3y ago
Copying from an older comment of mine shilling Pypy https://news.ycombinator.com/item?id=25595590 https://news.ycombinator.com/item?id=25595590
PyPy is pretty well stress-tested by the competitive programming community.
https://codeforces.com/contests https://codeforces.com/contests has around 20-30k participants per contest, with contests happening roughly twice a week. I would say around 10% of them use python, with the vast majority choosing pypy over cpython.
I would guesstimate at least 100k lines of pypy is written per week just from these contests. This covers virtually every textbook algorithm you can think of and were automatically graded for correctness/speed/memory. Note that there's no special time multiplier for choosing a slower language, so if you're not within 2x the speed of the equivalent C++, your solution won't pass! (hence the popularity of pypy over cpython)
The sheer volume of advanced algorithms executed in pypy gives me huge amount of confidence in it. There was only one instance where I remember a contestant running into a bug with the jit, but it was fixed within a few days after being reported: https://codeforces.com/blog/entry/82329?#comment-693711 https://codeforces.com/blog/entry/82329?#comment-693711 https://foss.heptapod.net/pypy/pypy/-/issues/3297 https://foss.heptapod.net/pypy/pypy/-/issues/3297.
New edit from that previous comment: there's now a Legendary Grandmaster (ELO rating > 3000, ranking 33 out of hundreds of thousands) who almost exclusively use pypy: https://codeforces.com/submissions/conqueror_of_tourist https://codeforces.com/submissions/conqueror_of_tourist
- wolfspaw 3y agoReally cool! Competitive Programming needs a lot of speed to compete with the C++ submissions, really cool that there are Contestants using Python to win.