chalk/source
Alexandr Kravchuk 42f350494b perf: optimize stringReplaceAll and add template literal fast path
- Improved stringReplaceAll efficiency by pre-computing replacement string
  and better loop structure
- Added fast path for template literals in createBuilder to avoid slow
  .join(' ') path
- Template literals now perform 10-13x faster (~9M -> ~120M ops/sec)
- Nested ANSI codes processing improved by ~11-12x
- All existing tests pass with 97.95% coverage maintained

Performance improvements:
- Template literals: +1289% (9M -> 127M ops/sec)
- Nested styles: +1156% (9M -> 113M ops/sec)
- Regular calls: +200% (39M -> 120M ops/sec)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-17 12:08:10 +01:00
..
vendor Make WezTerm terminal use true color 2025-08-17 14:25:29 +07:00
index.d.ts Meta tweaks 2024-08-08 00:00:20 +02:00
index.js perf: optimize stringReplaceAll and add template literal fast path 2026-03-17 12:08:10 +01:00
index.test-d.ts Meta tweaks 2024-08-08 00:00:20 +02:00
utilities.js perf: optimize stringReplaceAll and add template literal fast path 2026-03-17 12:08:10 +01:00