mirror of
https://github.com/yamadashy/repomix.git
synced 2026-03-29 11:58:46 +02:00
Pipeline-level optimizations that produce measurable end-to-end improvement: - Pre-initialize metrics worker pool during file collection phase so tiktoken WASM loading overlaps with security checks and file processing. First token count task dropped from 381ms to 22ms (worker already warmed). - Lazy-load Jiti via dynamic import — only loaded when TS/JS config files are detected, saving startup time for the common JSON/default config path. - Fix O(n²) file path re-grouping in packager by using Map + Set for O(1) membership checks instead of .find() + .includes(). - Move binary extension check before fs.stat in fileRead to skip unnecessary stat syscalls for binary files. - Parallelize split output file writes with Promise.all instead of sequential for-loop. Benchmark (15 runs each, median ± IQR, packing repomix repo ~1000 files): main branch: 3515ms (P25: 3443, P75: 3581) perf branch: 3318ms (P25: 3215, P75: 3383) Improvement: -197ms (-5.6%) Pipeline stage breakdown (instrumented): - Metrics first-file init: 381ms → 22ms (worker pre-warmed) - Total metrics stage: 793ms → ~450ms All 1096 tests pass. Lint clean. https://claude.ai/code/session_01JoNjFe7S2roMfHfNcw6bso