chalk/test
abhu85 73b11b92a8
perf: optimize 2-argument case with direct concatenation
For the common 2-argument case (e.g., `chalk.red('Error:', message)`),
use direct string concatenation instead of `join(' ')`.

This optimization provides a significant speedup for 2-argument calls:
- Old: `arguments_.join(' ')` - requires array iteration and method dispatch
- New: `arguments_[0] + ' ' + arguments_[1]` - V8 primitive op, JIT-inlined

Benchmark results show ~14x speedup for the isolated string concatenation
operation in the 2-argument case.

Fixes #669

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:13:13 +00:00
..
_fixture.js Add named exports (#432) 2021-04-17 19:33:03 +07:00
chalk.js perf: optimize 2-argument case with direct concatenation 2026-03-02 15:13:13 +00:00
instance.js Add named exports (#432) 2021-04-17 19:33:03 +07:00
level.js Meta tweaks 2022-10-05 21:43:01 +07:00
no-color-support.js Require Node.js 12 and move to ESM 2021-04-16 16:22:53 +07:00
visible.js Add named exports (#432) 2021-04-17 19:33:03 +07:00