On Fri, 20 Oct 2017 09:09:15 - Jan Mercl <0xj...@gmail.com> wrote:
Jan Mercl writes:
>
> On Fri, Oct 20, 2017 at 11:07 AM Bakul Shah wrote:
>
> > On the flip side, []*T will be less cache/TLB/GC friendly than
> > []T, unless T is much larger than a ptr. You are also
> > allocating an extra p
On Fri, Oct 20, 2017 at 11:07 AM Bakul Shah wrote:
> On the flip side, []*T will be less cache/TLB/GC friendly than
> []T, unless T is much larger than a ptr. You are also
> allocating an extra pointer per element. For small slices it
> probably doesn't matter much either way but when slices hold
On Fri, 20 Oct 2017 08:49:16 - Jan Mercl <0xj...@gmail.com> wrote:
Jan Mercl writes:
>
> On Fri, Oct 20, 2017 at 10:39 AM Ian Davis wrote:
>
> > How does that affect the size of []T or []*T ?
>
> No one said it does. What size of T affects is appending/inserting/deleting
> items to/from the
On Fri, Oct 20, 2017 at 10:39 AM Ian Davis wrote:
> How does that affect the size of []T or []*T ?
No one said it does. 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 Fri, 20 Oct 2017, at 06:34 AM, Jan Mercl wrote:
> On Fri, Oct 20, 2017 at 7:25 AM Feby Tanzil
> wrote:>
> > Which is better & preferable in Go?
>
> Depends on size of T.
How does that affect the size of []T or []*T ?
Ian
--
You received this message because you are subscribed to the Goog
On 20 October 2017 at 05:15, Feby Tanzil wrote:
> Hi,
>
> I got vague answers in the internet over this.
> Which is better & preferable in Go?
>
> type T struct {
> // some attributes
> ...
> }
>
> func a() []T {
>
> }
>
> func b() []*T {
>
> }
Both are plausible. It depends what you're going t
On Fri, Oct 20, 2017 at 7:25 AM Feby Tanzil wrote:
> Which is better & preferable in Go?
Depends on size of T.
--
-j
--
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 e
Hi,
I got vague answers in the internet over this.
Which is better & preferable in Go?
type T struct {
// some attributes
...
}
func a() []T {
}
func b() []*T {
}
Thanks
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe fr