Skip to content

Performance

Yuki edited this page Jul 10, 2026 · 1 revision

Performance

Run the local benchmark with:

npm run benchmark

The benchmark generates temporary locale files and a Vue source file, then measures:

  • config loading
  • locale loading and flattening
  • identical translation checks
  • placeholder checks
  • hardcoded string checks

The default fixture uses 3,000 generated key groups per locale.

Override it with:

I18N_SMELL_BENCH_KEYS=10000 npm run benchmark

This is a repeatable development benchmark, not a hard CI threshold. CI machines vary enough that performance assertions should be introduced only after collecting baseline data across multiple runs.

What To Watch

  • Avoid repeatedly reading the same locale file.
  • Keep glob expansion scoped to configured source roots.
  • Prefer parser-backed source scanning over broad regular expressions when behavior becomes complex.
  • Compare issue ids and stable fingerprints when changing report output.

Clone this wiki locally