When is PyPy slower than Python?

Правка en1, от FlakeLCR, 2020-09-24 21:35:42

In the most recent contest, Round #672 (Div. 2), I have identical submissions which TLE on PyPy 3.6, but are accepted in Python 3.

Problem C2:

PyPy 3.6: 93706296 (TLE)

Python 3: 93706871 (Accepted, 1871ms)

Problem D:

PyPy 3.6: 93722395 (TLE)

Python 3: 93721887 (Accepted, 1964ms)

Unfortunately, I did not realize to submit D on Python 3 before the end of the contest, so I did not get points for it.

We all know that PyPy is supposed to be faster, which is why the submission box suggests "Almost always, if you send a solution on PyPy, it works much faster" when you try to submit in Python.

However, this is not the first time I have had a solution only get accepted in Python, and having it happen twice in one contest is very frustrating, to say the least. In particular, having to guess which language to submit under is a great way to accumulate unnecessary penalty, and lower your ranking.

I'm wondering if anyone knows for what type of programs will PyPy tend to run slower than Python, and why this is the case. Any insight would be very helpful, thanks!

Теги #python 3, #pypy3, #tle

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский FlakeLCR 2020-09-24 21:35:42 1379 Initial revision (published)