Skip to content

Current version: 3.1.0

# JTCSV Performance

Benchmark Summary (Node.js 22, 10K rows/records)

CSV -> JSON (10K rows)

LibraryTimeMemoryRank
JTCSV (FastPath Compact)16.79 ms4.47 MB1st
JTCSV (FastPath Stream)18.27 ms6.03 MB2nd
JTCSV19.76 ms8.96 MB3rd
PapaParse21.57 ms6.97 MB4th
csv-parser30.52 ms6.53 MB5th

JSON -> CSV (10K records)

LibraryTimeMemoryRank
JTCSV11.21 ms4.77 MB1st
json2csv12.27 ms12.11 MB2nd

Scaling (JTCSV only)

Rows/RecordsCSV->JSON Time (FastPath Compact)JSON->CSV Time (JTCSV)CSV->JSON MemoryJSON->CSV Memory
1,0002.06 ms1.04 ms2.15 MB0.52 MB
10,00014.68 ms8.23 ms2.11 MB4.14 MB
100,000164.18 ms90.93 ms44.93 MB34.79 MB

Performance Optimizations (v2.2.9+)

JTCSV includes several performance optimizations to ensure maximum speed and minimal memory footprint:

1. Tree‑Shaking and Side‑Effects

  • Added "sideEffects": false to package.json – enables bundlers (Webpack, Rollup, Vite) to eliminate unused code.
  • Core functions are exported as ES modules for optimal tree‑shaking.

2. Fast Number/Boolean Parsing

  • Replaced regular‑expression‑based parsing with direct character checks and parseFloat.
  • Up to 2× faster for numeric‑heavy CSV files.

3. Single‑Pass BOM Stripping

  • BOM detection and removal now happen inside the main CSV parser stream, eliminating an extra Transform step.
  • Reduces overhead in streaming scenarios.

4. Optimized Delimiter Detection

  • New algorithm counts delimiter candidates in one pass over the first line using a Set.
  • Handles ties correctly (returns default ;).
  • ~30% faster than previous regex‑based detection.

5. Object‑Pooling (Planned)

  • Future release will reuse temporary objects to reduce GC pressure in high‑throughput streaming.

6. Entry Point Simplification

  • Package entry points are limited to 5 stable targets: /, /browser, /plugins, /cli, /schema.
  • Tree-shaking and selective imports are preferred over extra bundle flavors.

Methodology

  • Main benchmark: 5 iterations, average results.
  • Scale benchmark: 3 iterations, JTCSV only.
  • Command: npm run benchmark

For full details, see BENCHMARK-RESULTS.md.

Last updated: 2026-01-29

Released under the MIT License.