5 ms·
memcpy() was the best and fastest serializer from the start. It already existed in 1983.
by Naru41 2mo ago
memcpy() was the best and fastest serializer from the start. It already existed in 1983.
- vlovich123 2mo agoStart with; struct Point { int32_t x; int32_t y; } Now you want to add z. Whoops - plain memcpy results in corruption. struct Foo { struct Bar * bar; } Whoops, can’t transfer pointers across. Also horrible security issues constantly since this was the original serialization technique that was tried. There is a real reason that serialization frameworks exist and pretending like plain memcpy competes in the same space is either willful ignorance or trolling. Not to mention that these serialization frameworks are zero copy and thus end up being a memcpy to transfer, just with better schema evolution semantics and better safety
- pjmlp 2mo agoIf we ignore all portability and data stability issues.