1. 3

    Trying to implement (for example) NTPsec on Python would be a disaster, undone by high runtime overhead and latency variations due to GC.

    Go uses a GC as well, but one which is tuned more for latency afaik. Can the Python GC be tuned for latency? You can at least disable it (temporarily).

    1. 4

      Can the Python GC be tuned for latency?

      As far as I’m aware, the GC in CPython must stop-the-world and doesn’t have many tuning knobs. Maybe if you turn threshold0 way down, threshold1 up a little and left threshold2 more or less alone, the 50th %ile GC latency would get lower, at the cost of throughput (more, shorter young-generation collections)? The worst-case GC latency wouldn’t get any better though.

      You can at least disable it (temporarily).

      You can switch CPython’s GC off and leave it off (and have only refcounting) if you’re prepared to live without reference cycles.

      I would expect the majority of libraries on PyPI have never been tested with the GC turned off. I wouldn’t be very surprised if people ignored pull requests that made their libraries more complicated for the sole purpose of enabling them to be used without the GC.

      1. 7

        Yeah. I suspect he never tried? Even if Python is too slow, would Java or OCaml have been a perfectly adequate language for that kind of project? It’s hard to believe the answer is no if Go is an option.

        As someone who got started with ML in 2005, C seemed obviously obsolete even then.

        1. 2

          I’d definitely guess he never tried. Python is refcounted and in the common case the latency is (high but) mostly deterministic