|
|
Subscribe / Log in / New account

Cuni: PyPy for low-latency systems

Antonio Cuni writes about recent work to support running Python code with low latency requirements under PyPy. "As we said, the total cost of memory management is less on PyPy than on CPython, and it's one of the reasons why PyPy is so fast. However, one big disadvantage is that while on CPython the cost of memory management is spread all over the execution of the program, on PyPy it is concentrated into GC runs, causing observable pauses which interrupt the execution of the user program. To avoid excessively long pauses, the PyPy GC has been using an incremental strategy since 2013. The GC runs as a series of 'steps', letting the user program to progress between each step."

to post comments

Cuni: PyPy for low-latency systems

Posted Jan 4, 2019 14:58 UTC (Fri) by mm7323 (subscriber, #87386) [Link] (1 responses)

Using Python and Garbage Collection seems like a poor footing for a low-latency system to me, though the article doesn't describe exactly what the target is for low-latency.

Also the article doesn't seem to agree with itself:

... on CPython the cost of memory management is spread all over the execution of the program,
and yet
To avoid excessively long pauses, the PyPy GC has been using an incremental strategy since 2013. The GC runs as a series of 'steps', letting the user program to progress between each step.

So spreading the cost of memory management all over the program?

There's already loads or research on parallel and incremental GC techniques which avoid peppering code with manual GC steps. This just looks like the bad old days of early Java before the GC was made quite good.

Perhaps they would be better looking a Jython?

Cuni: PyPy for low-latency systems

Posted Jan 9, 2019 11:14 UTC (Wed) by auc (subscriber, #45914) [Link]

Jython looks dead, also irrelevant to PyPy.

Also, Cuni's strategy isn't about "peppering code with manual GC steps" but precisely adopting an incremental GC.

Cuni: PyPy for low-latency systems

Posted Jan 6, 2019 10:42 UTC (Sun) by tuna (guest, #44480) [Link] (1 responses)

If you are running something graphically interactive you do not want to > 16 ms frame times. So all pythons seems really bad for those workloads.

Cuni: PyPy for low-latency systems

Posted Jan 11, 2019 17:05 UTC (Fri) by k8to (guest, #15413) [Link]

Classic cpython works fine for graphic user interface type stuff. Those types of workloads worked fine on 4mhz cpus after all.

If you're building a videogame, then there are certainly limits and I would not reach for python.


Copyright © 2019, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds