benchmarks #
tsv is a formatter, parser, and future linter + more for TypeScript, Svelte, and CSS.
Please note, this is an early-stage project and these numbers will change, both upwards and downwards.
Binary size #
Rather than supporting many languages, tsv focuses on Svelte, TypeScript, and CSS. This lets it be smaller when it's all you need, a quality that's more relevant when used in the browser via wasm:
wasm
native
Speedier than Prettier #
tsv is heavily inspired by and borrows architectural patterns from Prettier. We're very grateful for the hard work of its contributors. tsv offers a speedup over Prettier:
| Svelte 1194 of 1240 files | TypeScript 3701 of 4025 files | CSS 165 of 193 files | |
|---|---|---|---|
| native | 12.4x | 10.3x | 17.3x |
| wasm | 9.06x | 7.66x | 12.9x |
Format #
tsv's formatter is similar to Oxfmt and Biome. Today it can format TypeScript, Svelte, and CSS, plus JS as strict-mode TypeScript:
Formatting 1194 of 1240 svelte files:聽路 annotation = files handled / total
Formatting 3701 of 4025 typescript files:聽路 annotation = files handled / total
Formatting 165 of 193 css files:聽路 annotation = files handled / total
Parse #
The parse rows that build a full JS AST are directly comparable: tsv and oxc-parser both serialize the AST to JSON in Rust and deserialize it in JS, native and wasm alike. The tsv-internal and tsv_wasm-internal rows are tsv's parse-only numbers - they build the native AST but skip JS-side materialization, so they show raw in-engine speed rather than a cross-tool comparison.
Parsing 1192 of 1240 svelte files:聽路 annotation = files handled / total
Parsing 3603 of 4025 typescript files:聽路 annotation = files handled / total
Parsing 159 of 193 css files:聽路 annotation = files handled / total
Benchmarking details #
All numbers are single-threaded: every library formats or parses one file at a time, measured sequentially with no cross-file parallelism. These are per-file, single-core latency and throughput numbers - not the multi-core batch throughput a CLI gets when it formats many files at once, which most of these tools (tsv included) can do.