2 ms·
> Passing structs up to size 256 is very cheap, and uses SIMD registers. Presumably this means for all arguments combined? If for example you pass four pointer
by layer8 1y ago
> Passing structs up to size 256 is very cheap, and uses SIMD registers.
Presumably this means for all arguments combined? If for example you pass four pointers each pointing to a 256-byte struct, you probably don’t want to pass all four structs (or even just one or two of the four?) by value instead.
- adastra22 1y agoIf you’re actually passing pointers to heap allocated objects, the pointer is the value.
- hyghjiyhu 1y agoIf I understand correctly he is passing a single struct whose size he varies. This struct is being memcpy'd to stack (except for very small struct sizes that can be passed directly in registers) and so basically we are looking at a curve of memcpy performance by size.