Valerio Gheri’s Post

View profile for Valerio Gheri, graphic

Engineering Director at Veepee | Tribe Lead

Have you ever wondered whether the order of fields within a Go struct affects memory consumption or application performance? I did, and it turns out that it might indeed have an impact. The reason? Memory alignment requirements in modern CPU architectures. I documented my understanding of the topic at https://lnkd.in/ddDsG8MU . Take a look if you're interested, feedback is appreciated!

Go memory layout and struct alignment

Go memory layout and struct alignment

blog.valeriogheri.com

To view or add a comment, sign in

Explore topics