On Sun, Sep 5, 2021 at 10:00 AM 'Dan Kortschak' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> There is a reason for choosing a factor less than 2; released blocks
> during reallocation are able to be reused in later allocations (for the
> same slice when grown — something that cannot happen for the case of 2
> or greater).


This sounds interesting, but I don't understand it. Would you be willing to
expand on this?


> Interestingly, Go uses the 1.25× factor while others
> appear to use values in the range of 1.5× to less than 2×, with a claim
> that phi is the optimum.
>
> There is no discussion in the introduction of append for the choice of
> the growth factor: https://codereview.appspot.com/2757042
>
>
> --
> 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/bcf24b8e53f3bc6aafb186ced57b614b4ecf4891.camel%40kortschak.io
> .
>

-- 
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/CAEkBMfE7RDShq3K6gfhvUWbjykMJ9%3DzooQ1PzrvwiPiEcTtDEQ%40mail.gmail.com.

Reply via email to