← Back to context

Comment by harrisi

1 day ago

I'm surprised there's no mention in the post or here about SQLite's varint encoding. Not that it would necessarily satisfy the constraints, but it's one of the most used varint implementations.

It's not terribly fast. It's faster than LEB128 but not as fast as vu128 (at least according to https://github.com/Jiboo/varint_benchmark)

  • The post says the purpose of exploring this space (which is a fun one) wasn't speed, but representation. The speed gain was an added value.

    I'm not saying SQLite's varint implementation is ideal for every application. It's just an implementation that is one of the most used implementations, if not the most (I'd bet it is by a large margin though). It just seemed like a missed opportunity to compare it with the implementation they landed on.

    EDIT: Just wanted to add, thanks for sharing that link. Interesting!