▲ | kannanvijayan 4 days ago | |
Varint encoding is something I've peeked at in various contexts. My personal bias is towards the prefix-style, as it feels faster to decode and the segregation of the meta-data from the payload data is nice. But, the thing that tends to tip the scales is the fact that in almost all real world cases, small numbers dominate - as the github thread you linked relates in a comment. The LEB128 fast-path is a single conditional with no data-dependencies:
Modern CPUs will characterize that branch really well and you'll pay almost zero cost for the fastpath which also happens to be the dominant path.It's hard to beat. | ||
▲ | yencabulator 4 days ago | parent [-] | |
SQLite format equivalent:
while strictly improving all other aspects (at least IMHO) |