[Info-vax] Rust as a HS language, was: Re: Quiet?

Dan Cross cross at spitfire.i.gajendra.net
Wed Apr 6 09:56:56 EDT 2022


In article <624d911f$0$702$14726298 at news.sunsite.dk>,
Arne Vajhøj  <arne at vajhoej.dk> wrote:
>On 4/5/2022 9:30 PM, Dan Cross wrote:
>> Eh?  It's commonly accepted that you're going to give up some
>> percentage of your capacity for GC overhead. 
>
>No it is not.

Sorry, but yes it is.

>With generational garbage collectors it is very fast to GC
>short lived objects.

That does not mean that you aren't going to give up some
percentage of your capacity for GC.  GC is not infinitely fast.

>>                                         The Go runtime
>> reserves 25% of CPU time for GC, for instance.
>
>I don't know Go that well.
>
>But that is absolutely horrible.
>
>It should be less than 5%.

Note that I said that, "the Go runtime _reserves_ 25% of CPU
time for GC."  That is not the same as the Go runtime _using_
25% of CPU capacity for GC.  In practice, overhead is closer
to 5% (which is still not 0%).

>Go does not use generational garbage collection - it tries
>on escape analysis to put stuff on stack instead of heap. But
>if the 25% is correct then they made the wrong decision.

Go's garbage collector is concurrent.  Here's a video that Rick
Hudson presented about the Go GC:

https://www.youtube.com/watch?v=aiv1JOfMjm0

>>> The problem with GC is the poor real time characteristics.
>>> It tend to give small pauses at non-deterministic point.
>> 
>> That's the old style GC.  Go's concurrent GC mostly avoids that
>> unless under severe memory pressure.
>
>No.

Actually, yes.

>Go GC use STW. They have managed to reduce the time but it is
>still a STW.

Note that I said that, "Go's concurrent GC _mostly_ avoids
that unless under severe memory pressure."

>The only GC I am aware of that does not do STW is Azul Zing.

The LVB in Azul is basically a localized pause.  It may be true
that Azul doesn't STW, but that doesn't mean that it's free.

"We also differentiate between the notion of a global safepoint,
where are all the mutator threads are stopped, and a checkpoint,
where individual threads pass through a barrier function"

(https://dl.acm.org/doi/pdf/10.1145/2076022.1993491 sec 4)

Under severe memory pressure pretty much all of the threads will
block in the LVB and the situation will be more or less
indistiguishable from a STW pause.

	- Dan C.




More information about the Info-vax mailing list