https://play.golang.org/p/xILWETuAii
I have started to use non pointer slices much more as of late. Every time I bother measuring it is always faster and it is better for the GC (usually, caveats apply). It also, perhaps naively, feels safer... :) fre 20 okt. 2017 kl 13:41 skrev Juliusz Chroboczek <j...@irif.fr>: > >> What size of T affects is appending/inserting/deleting items to/from > >> the slice. If one passes around a value of type []T, those operations > >> are probably performed on the value. > > > On the flip side, []*T will be less cache/TLB/GC friendly than > > []T, unless T is much larger than a ptr. > > On the edge side, []T cannot be easily ranged over in a mutable way: > https://play.golang.org/p/6kpQWkLQEW > > -- Juliusz > > -- > 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. > For more options, visit https://groups.google.com/d/optout. > -- 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. For more options, visit https://groups.google.com/d/optout.