News for hackers. Stuff that matters.
Re:Padding is hard by Someone on Friday October 09, 2015 @12:19PM (#10361112)
I would guess that their stance is "If you care about that, do it yourself"

IMO, that is the right attitude, given that moving fields around may interfere with how parts of large structures map to cache lines, and that may have huge performance impacts, if some parts of a structure are rarely accessed.

Yes, the compiler could try to optimize that, too, but saying that is a hard problem is an understatement, and it needs statistics that the compiler doesn't have available. So, it definitely is unsuitable for go's goal of fast compilation.

Re:Padding is hard by masklinn on Friday October 09, 2015 @12:37PM (#10361283)
> I would guess that their stance is "If you care about that, do it yourself"

No, struct layout is currently undefined[0] so you can't do that yourself. Any manual packing you defined today may or may not hold across platforms or future go revisions.

[0] https://github.com/golang/go/issues/10014