Killing a `Cow` made my JSON formatter 42% faster
The article discusses improvements in JSON formatting speed achieved by a new formatter called JJPWRGEM. By implementing number normalization techniques, the formatter became 42% faster than its previous version. While Oxfmt has made strides in JavaScript formatting, it still lags behind Prettier for JSON files, which JJPWRGEM aims to address with its upcoming features.
- ▪JJPWRGEM can format JSON files around 30 milliseconds, significantly faster than Oxfmt and Prettier.
- ▪Oxfmt is currently 10-20% slower than Prettier for JSON formatting.
- ▪The author implemented number normalization techniques that improved JJPWRGEM's performance by 42%.
Opening excerpt (first ~120 words) tap to expand
Killing a `Cow` made my JSON formatter 42% faster Em dashes: 12 May 5, 2026 A formatter styles code consistently, usually improving human readability. If you are unfamiliar with formatters, tokenizers, or abstract syntax trees, see my article on how formatters work The JavaScript ecosystem has a gap—most formatters are either featureful or fast. Prettier is the standard in the JavaScript ecosystem, but it’s not the fastest. Oxfmt has made major strides—supporting parity with Prettier’s JavaScript formatting with much improved performance. One report found a migration to Oxfmt formatted their repo 6.5x faster—from 13.9 seconds to 2.1 However these gains do not apply to JSON. Oxfmt is 10–20% slower than Prettier for JSON.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Jacobasper.