Saving a Third of Our Memory by Re-ordering Go Struct Fields
We had application at one of my previous companies that typically ran with ~2GB in memory at any given time, but simply changing the order of some uint variables we managed to drop the memory usage to less than 1.4GB. Let’s dive into how inefficient field ordering in Go structs can have a huge impact on the memory footprint of a program.
Source: Saving a Third of Our Memory by Re-ordering Go Struct Fields, an article by Lane Wagner.