Skip to content

Comment on The Most Expensive One-byte Mistake (2011)parent

Comments

You piqued my interest, and it looks like NUL-terminated strings in files is actually common. tar, ELF, JPEG, gzip all use them. When the serialization format matches the in-memory format, you can mmap directly into a struct, which is fast and convenient.

When the serialization format matches the in-memory format, you can mmap directly into a struct, which is fast and convenient.

...and a non-starter if you ever have data interchange between differing types of machines.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.