PyPy for low-latency systems
morepypy.blogspot.com
morepypy.blogspot.com
edit: added more details I remembered later
Not entirely sure how you'd go about writing code like that, but it's possible.
[0]: https://en.wikipedia.org/wiki/Ultra-low_latency_direct_marke...
There has never been a strict definition of “low latency”. It is heavily context-dependent. Something which is not “low latency” enough for live audio or a car’s steering controller might be plenty fast for an internet text chat service.
Soft: After X time, usability of the data degrades with age.
Hard: After X time, the data is useless (example: realtime car control systems; if you take too long the car has already crashed)
real-time == "bounded latency" (to a soft or hard degree).
low-latency implies no threshold, just low relative to something else.
Soft real time is video decoding: We need to render 1 frame every 1/30th-ish per second. If we miss our deadline, we either need to skip that frame and move onto the next, or pause to fill a buffer.
You can have a hard real time system where the latency required is measured in seconds and a soft realtime system where the deadline is in nanoseconds.
Whatever it was, it certainly wasn’t real-time.
In this case, Gambit (the outfit who sponsored this work) are a stat arb shop doing HFT. So I'd say the label fits.
I don't think there's any way to consider a phrase like "low latency" without considering what you're talking about.
Source: software engineer who's worked (or still works) for electronic trading firms for the last 10ish years.
As another poster commented about, it is not uncommon in RF. Fiber optics along with Microwave radios are common in the space. The goal is to get to the limit of what physics allows ultimately.
Reference counting allows you (if needed) to keep references to memory in your python code, and free them in the right spots.
This is PyPy becoming useful for a lot more production use cases. From web APIs that have a latency SLA, to audio, games. In many cases peak performance is not important, it's the minimum performance.
PyPy now lets you control where memory management happens. Making it possible to control worst case performance. For many production apps this is a big deal.
You also cannot disable the minor collections in PyPy, only the major collections, but once the JIT kicks in PyPy can prevent some of the object churn by optimizing instances away.
This is certainly an improvement, but not a complete solution.
You already have to have enough of them to handle events while other workers are busy.
Terrible title, but basically the same idea.
I'm conflicted on this. My gut tells me if I'm going to manually take control over the garbage collector I should reconsider my design decisions.
Disclaimer, I don't know the first thing about PyPy or Gambit Research, so probably this is the right approach for them?