3 ms·
Except that hashing a block of memory is likely to be much faster than hashing individual fields once there are more than a couple fields. IMO the right soluti
by amluto 8y ago
Except that hashing a block of memory is likely to be much faster than hashing individual fields once there are more than a couple fields.
IMO the right solution would be a special annotation on a struct that says “I want the logical value of this struct to uniquely determine the bytes of the struct’s in-memory representation.”
Of course, adding such an attribute without nasty edge cases may be tricky.
- Tarean 8y agoBut this mostly matter for arrays and then an alternative optimization might be to store it as a structure of arrays. This doesn't need the padding and is more simd friendly.