By

Bytery – a binary JSON protocol ~10x faster and ~10x smaller

Hacker News

Bytery – a binary JSON protocol ~10x faster and ~10x smaller

I created a JSON codec called Bytery, which is about 10x faster and 10x smaller for storage and transport. It is not just an implementation; it is a full protocol that can be implemented in any language. The major gains in performance and size come from highly compact binary data formats: packing numbers into fewer bytes, avoiding repeated strings and schemas, and applying other low-level optimizations. Here are just a few optimizations I implemented: Encoding integers: - JSON represents integers (and everything else) as textual tokens, depending on parsers, digit decoding such as char - 48, and delimiters. - Bytery represents integers as LUINT: a single byte, if value is up to 246. Values 247..254 indicate that the following additional 1..8 bytes should be used to build a big-endian integer, and 255 means null. Encoding strings: - JSON represents strings with delimiters, escapes, and a pair of quotes, and it costs CPU to scan until the closing quote while also handling escape sequences. - Bytery represents strings as a pair [length:LUINT,data]. It reads the length as a LUINT and then reads exactly that amount of bytes. Fast, no parsing, no delimiters, no quote scanning, no escape processing. * These are just a few examples. There are a lot more, like string cache table, schema cache, field types, etc. * The full spec.md has around 4k lines of specification, all written with care. The protocol is fully lossless and can handle any standalone JSON object without requiring prior knowledge of schemas or data structures. Bytery can also transport files in native binary format, without converting them to Base64 and paying the ~30% size overhead. Bytery can also be combined with GZIP and other post-processing tools to make the payload even smaller. My focus here is the protocol and wire format itself. The project is free to use. My goal is to free the internet from the heavy overhead cost of parsing, storing, and transporting JSON through the wire, while allowing data to be decoded at high speed on the client.

Share card

Actual performance

2points
2comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: created · Missing: supports, reddit linkedin, podcasting
81%81% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Hacker NewsStrong engagement from HN community · Strong signals: io · Missing: https docs, excited, just released
61%61% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
48%48% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
46%46% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: single, coding, code · Missing: mac, agents, macos
40%40% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
21%21% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

knotend
knotend49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

10x faster flowchart editor

Indie Hackers1productivity
10
10x Faster Twitter Embeds58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

10x Faster Twitter Embeds

Hacker News14
Sh
Ship Code 10x Faster64%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Ship Code 10x Faster

Hacker News1
Up
Uptrace v2.0: 10x Faster Open-Source Observability with ClickHouse JSON78%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Uptrace v2.0: 10x Faster Open-Source Observability with ClickHouse JSON

Hacker News7
It
Iterate on MVPs 10x Faster57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Iterate on MVPs 10x Faster

Hacker News1
Eloquent
Eloquent29%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Grow on LinkedIn 10X Faster

Indie Hackers
Eloquent
Eloquent32%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Grow on LinkedIn 10X Faster

Indie Hackerscommitment-side-project
Cl
CloudRail 3.0 – Connect to APIs 10x Faster55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CloudRail 3.0 – Connect to APIs 10x Faster

Hacker News2
Xponentix
Xponentix42%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

10x faster funding access for startups

Indie Hackerscommitment-full-time
Le
Learn 10x Faster Than Spaced Repetition with Guided Mnemonics67%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Learn 10x Faster Than Spaced Repetition with Guided Mnemonics

Hacker News6