Tomás Senart (@tsenart) on X

X (formerly Twitter) ·

1 min read Original article ↗

Back in the day, when I first heard the term "zero-copy" serialization, I was truly mystified. How could that possibly work?

It was a cool, hot and fast thang I wanted to use but didn't understand.

These days, we have a bit (or a lot) of it in many serialization libraries like FlatBuffers, Protobuf and so on.

But, friend, let me save you the trouble in your search for meaning. There's not much else to it than this.

Uuuuuh, unsafe, spicy and yet frightful! So many emotions to hold at once.

But ultimately, I sure hope, you might wonder, how does this fare against the good old "copyful" serialization you know and love? I gotchu bud, here are the benchmarks 🤗

-98%?!?!? Damn that's just my kind of jam. Cool, hot and faaaast. 🆒🔥🚀

I couldn't write about this and not leave a mandatory "safety" notice. Your computer's warranty may be voided, and tiny little angry Gophers may come steal your food.

If for some god-forsaken reason you're sending bytes between machines with different endianness, well, don't do this, and think about your life choices, friend.

I hope you enjoyed this tidbit of whimsical demystification <3