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

Add colorette to the benchmarks #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prantlf
Copy link

@prantlf prantlf commented Dec 30, 2020

Attempts to fix #35. I upgraded chalk to the latest (minor) version too.

Both kleur and colorette are the fastest with colorette having the upper hand. It appears that kleur trades run-time for loading-time performance :-)

The numbers:

$ node load

chalk: 11.326ms
kleur: 0.662ms
kleur/colors: 0.438ms
ansi-colors: 1.961ms
colorette: 2.13ms

$ node colors

# All Colors
  ansi-colors      x 218,607 ops/sec ±0.35% (91 runs sampled)
  chalk            x 918,282 ops/sec ±0.26% (96 runs sampled)
  colorette        x 1,529,758 ops/sec ±0.87% (96 runs sampled)
  kleur            x 1,166,639 ops/sec ±0.64% (92 runs sampled)
  kleur/colors     x 1,426,030 ops/sec ±0.23% (93 runs sampled)

# Stacked colors
  ansi-colors      x 26,428 ops/sec ±0.95% (94 runs sampled)
  chalk            x 589,847 ops/sec ±0.15% (94 runs sampled)
  colorette        x 115,505 ops/sec ±0.81% (93 runs sampled)
  kleur            x 89,383 ops/sec ±1.10% (93 runs sampled)
  kleur/colors     x 111,107 ops/sec ±0.10% (97 runs sampled)

# Nested colors
  ansi-colors      x 78,378 ops/sec ±0.08% (93 runs sampled)
  chalk            x 127,300 ops/sec ±0.21% (97 runs sampled)
  colorette        x 160,043 ops/sec ±0.22% (98 runs sampled)
  kleur            x 135,730 ops/sec ±1.11% (94 runs sampled)
  kleur/colors     x 144,491 ops/sec ±0.40% (97 runs sampled)

Upgrade chalk to the latest version too.
@codecov-io
Copy link

Codecov Report

Merging #44 (a2cd1e5) into master (fc9cc25) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #44   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files           2        2           
  Lines         163      163           
  Branches       28       28           
=======================================
  Hits          161      161           
  Misses          1        1           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc9cc25...a2cd1e5. Read the comment docs.

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.

Add colorette to benchmark comparison
2 participants