3 ms·
May is very much the operative word here. The common and normal behaviour you want is to minimise struct size so you can fit the maximum instances in cache and
by masklinn 5y ago
May is very much the operative word here.
The common and normal behaviour you want is to minimise struct size so you can fit the maximum instances in cache and memory.
The need for more precise control is very much the exception, and thus not unlike preventing inlining (which you may actually want) it could (and should) be an opt-out.
- jlrubin 5y agomy point is that these are the fat tail + survivor bias of cases where you do actually care about performance to this degree, so it probably is actually more common in practice when you're looking into it. even though precise control is the exception, if you can't do it, you can't use your language in a lot of critical contexts (and end up linking C, Zig, Rust, etc).
- masklinn 5y ago… Nobody said you should not be able to do it, at all? The argument is about default behaviour. Rust is specifically a langage which reorders by default.
- jlrubin 5y agoscottlamb seemed to be implying it's not worth being able to since it's an uncommon use case, so I was explaining why even if it's uncommon it's must-have.