Skip to content

Performance

Subforge is tuned for large subtitle sets and supports fast paths for common patterns.

Benchmarks

Run the full benchmark suite:

bash
bun run bench

100k parse benchmark

These numbers are from isolated runs (each format executed in its own process) using bun tests/bench/quick-isolated.ts --sort.

Format100k parse (ms)
VobSub none4.59
DVB5.03
VobSub idx6.93
PAC7.21
Teletext8.74
SBV11.61
SCC11.74
DFXP12.52
TTML12.53
SMPTE-TT12.88
LRC13.02
RealText14.31
QT14.60
ASS15.21
SSA15.44
Spruce STL15.75
SAMI16.28
EBU-STL16.28
PGS17.48
CAP17.70
VobSub18.88
VobSub rle19.09

Results vary by hardware and Bun version. Re-run the command to refresh numbers. VobSub numbers assume the .idx is parsed once (see VobSub idx row); the VobSub row measures .sub parsing + image decode.

Quick 100k parse matrix:

bash
bun tests/bench/quick.ts

Isolated per-format matrix (avoids GC drift):

bash
bun tests/bench/quick-isolated.ts --sort

Tips

  • Prefer subpath entry points to reduce bundle size.
  • Keep event.dirty false when you do not need to reserialize text.