News for hackers. Stuff that matters.
Re:Why Discord is switching from Go to Rust (2020) by tjalfi on Monday February 22, 2021 @03:39PM (#26230261)
> I agree with you on that but this still makes me question the problem they are trying to solve can't they solve in Go instead of switching to Rust.

High performance systems in GC languages often preallocate or use object pools to reduce time spent in the garbage collector. LMAX's Disruptor, for example, allocates all memory at startup; no additional memory is allocated so the garbage collector never runs. Generational GCs make this strategy more effective because long-lived or large objects are traced rarely or not at all. Another option for trading systems is to run garbage collection after hours when the market has closed.

Go's GC is conservative, not generational, and has a hard coded collection interval of 2 minutes; you pay for a GC even if no memory has been allocated. There are only a few configuration options for Go's GC; if it doesn't work for your use case then you can either fork or use a different language.

There are no comments on this comment yet.