There is no right answer to your question. Optimiation is often a balancing act between competing goals, for example, cpu vs menory, speed vs memory safety, different workloads, avoiding worst cases, and so on.
Here's a peek at the problem in 2018: https://go.dev/blog/ismmkeynote.Since then, there have been other refinements. In 2018,, a primary goal was to reduce gc latency. Once you fix that, other issues come to the fore. Peter On Tuesday, December 14, 2021 at 4:14:14 AM UTC-5 kurnia...@gmail.com wrote: > oh, maybe they just trying random configuration (1min, 5min, or something > else) > and 2min is the best result > > On Tuesday, December 14, 2021 at 4:13:05 PM UTC+7 Kurnia D Win wrote: > >> okay, thanks for the explanation, >> suggesting me to change language to rust/c is not answering my curiosity >> I ask it because I'm trying to learn the runtime, and the "why" behind >> some decision that already made >> for now, I will just follow it blindly, because the go developers already >> made that decision >> >> thank you >> >> On Tuesday, December 14, 2021 at 3:27:18 PM UTC+7 Brian Candler wrote: >> >>> On Tuesday, 14 December 2021 at 03:28:26 UTC kurnia...@gmail.com wrote: >>> >>>> the problem with it, when you have a large live heap but with efficient >>>> code (most of the hot code is zero alloc), the runtime will be wasting CPU >>>> time every 2 minutes just to find out that there is no garbage to collect >>>> >>> >>> Let's say it wastes, say, 10 milliseconds every 2 minutes - and it >>> doesn't even stop the program for that time but runs GC in a separate >>> thread. Is that a big deal, in order to give reasonable behaviour across a >>> wide range of programs? >>> >>> If you need such fine low-level control, then maybe a different language >>> like Rust (or even C) might be better for your application. >>> >>>> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/90c4c799-bf1f-4850-9c42-8d346d80778bn%40googlegroups.com.