3 ms·
> Yes, you discard the ability to just jump to any random field, but that is not always important. I don't think this is the criticism being raised. The main
by fluffything 6y ago
> Yes, you discard the ability to just jump to any random field, but that is not always important.
I don't think this is the criticism being raised.
The main criticism being raised against non-zero-copy serialization is that this often requires maintaining different memory representations for the same value - the copies are the consequence of transforming from one representation to another one.
- jeffbee 6y agoWe do that all the time in high-performance computing. You keep a packed representation in memory and unpack it in small pieces to operate on it. Sparse matrices, compressed columns, etc. This is not evil, it’s an adaptation to the way the machine works. Saying that Kenton’s definition of zero-copy is unconditionally better is an aesthetic argument and I don’t buy it.
- fluffything 6y agoYou are still not getting it. They are not talking about "unpacking on the fly for processing", but rather about "unpacking on memory to be able to call an opaque API outside your control that expects the unpacked representation". That requires copying in-memory to interface with that API. Your approach only works if you are willing to "re-implement the world" to interface with whatever packed format suits your application. With zero-copy serialization you don't have to do that.
- jeffbee 6y agoWe can both advocate for different perspectives on this issue without either of us “not getting it”.
- Dylan16807 6y ago> Saying that Kenton’s definition of zero-copy is unconditionally better It feels like you're conflating things here. It's not always a better algorithm, but it's a better definition.