Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(lib): replace redundant reduce call on array #59

Merged
merged 4 commits into from
Jan 10, 2025
Merged

Conversation

Fdawgs
Copy link
Member

@Fdawgs Fdawgs commented Jan 5, 2025

Array of colors does not need to be reduced as the array returned by Object.entries(colors) is suitably structured anyway!

Benchmarks

Before:

formatMessageColorized x 3,222,129 ops/sec ±0.74% (191 runs sampled)

After:

formatMessageColorized x 3,541,809 ops/sec ±0.56% (189 runs sampled)

Checklist

lib/messageFormatFactory.js Outdated Show resolved Hide resolved
@Fdawgs Fdawgs changed the title perf(lib): replace accumulator spread with push perf(lib): replace accumulator spread with for...of Jan 8, 2025
Co-authored-by: Gürgün Dayıoğlu <[email protected]>
Signed-off-by: Frazer Smith <[email protected]>
@Fdawgs Fdawgs changed the title perf(lib): replace accumulator spread with for...of perf(lib): replace redundant reduce call on array Jan 8, 2025
@mcollina
Copy link
Member

mcollina commented Jan 9, 2025

CI seems failing

@Fdawgs
Copy link
Member Author

Fdawgs commented Jan 9, 2025

CI seems failing

Workflows are still annoyingly using 22.12 rather than 22.13, which fixed the Windows issue that this is flagging.

@Fdawgs Fdawgs requested a review from mcollina January 10, 2025 10:48
@Fdawgs Fdawgs merged commit a956bcb into master Jan 10, 2025
13 checks passed
@Fdawgs Fdawgs deleted the perf/spread-reduce branch January 10, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants