Re:The x86 architecture is the weirdo (2004)
by anyfoo on Tuesday April 19, 2022 @04:13PM
(#31088385)
FWIW, it's still better to lay out your critical structures carefully, so that padding isn't needed. That way, you win both the cache efficiency and the efficiencies for aligned accesses.
[ Parent
| on HN ]
Re:The x86 architecture is the weirdo (2004)
by mjevans on Tuesday April 19, 2022 @08:40PM
(#31091351)
One of the forms of 'premature optimization' that's often worth doing. Just align everything you can to the biggest power of two data-size you can. Also, always use fixed sized data types. E.G. (modular int) uint32 or (signed 2s comp) sint32 rather than int