| ▲ | cranx 4 hours ago | |||||||||||||||||||
I find the title a bit misleading. I think it should be titled It’s Faster to Copy Memory Directly than Send a Protobuf. Which then seems rather obvious that removing a serialization and deserialization step reduces runtime. | ||||||||||||||||||||
| ▲ | MrDarcy 4 hours ago | parent | next [-] | |||||||||||||||||||
TIL serializing a protobuf is only 5 times slower than copying memory, which is way faster than I thought it’d be. Impressive given all the other nice things protobuf offers to development teams. | ||||||||||||||||||||
| ||||||||||||||||||||
| ▲ | bluGill 3 hours ago | parent | prev | next [-] | |||||||||||||||||||
Protobuf does something important that copying memory cannot do: a protocol that can be changed separately on either end and things can still work. You have to build for "my client doesn't send some new data" (make a good default), or "I got extra data I don't understand" (ignore it). However the ability to upgrade part of the system is critical when the system is large and complex since you can't fix everything to understand your new feature without making the new feature take ages to roll out. Protobuf also handles a bunch of languages for you. The other team wants to write in a "stupid language" - you don't have to have a political fight to prove your preferred is best for everything. You just let that team do what they want and they can learn the hard way it was a bad language. Either it isn't really that bad and so the fight was pointless, or it was but management can find other metrics to prove it and it becomes their problem to decide if it is bad enough to be worth fixing. | ||||||||||||||||||||
| ||||||||||||||||||||
| ▲ | miroljub 4 hours ago | parent | prev | next [-] | |||||||||||||||||||
Yep. Just doing memcpy or mmap would be even faster. But the same Rust advocates bragging about Rust speed frown upon such unsecure practices in C/C++. | ||||||||||||||||||||
| ▲ | infogulch an hour ago | parent | prev | next [-] | |||||||||||||||||||
Why don't we use standardized zero-copy data formats for this kind of thing? A standardized layout like Arrow means that the data is not tied to the layout/padding of a particular language, potential security problems like bounds checks are automatically handled by the tooling, and it works well over multiple communication channels. | ||||||||||||||||||||
| ▲ | lenkite 2 hours ago | parent | prev | next [-] | |||||||||||||||||||
How we used Claude and bindgen to make Rust catch up with C's 5x performance. | ||||||||||||||||||||
| ▲ | 3 hours ago | parent | prev [-] | |||||||||||||||||||
| [deleted] | ||||||||||||||||||||