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

Benchmark output can be improved #5895

Closed
6 tasks done
guoyunhe opened this issue Jun 16, 2024 · 1 comment · Fixed by #7019
Closed
6 tasks done

Benchmark output can be improved #5895

guoyunhe opened this issue Jun 16, 2024 · 1 comment · Fixed by #7019
Labels
feat: benchmark Issues and PRs related to the benchmark feature p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome

Comments

@guoyunhe
Copy link
Contributor

Describe the bug

If you write multiple benchmark group in a single file, the output isn't very clear to separate different test cases:

   ✓ setAlpha (2) 7444ms
     name                        hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · @ctrl/tinycolor  18,716,735.25  0.0000  0.0122  0.0001  0.0001  0.0001  0.0001  0.0001  ±0.02%  9358368
   · fastcolor        19,874,881.13  0.0000  0.0291  0.0001  0.0001  0.0001  0.0001  0.0001  ±0.03%  9937441   fastest
   ✓ toHexString (2) 3935ms
     name                        hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · @ctrl/tinycolor   5,342,122.96  0.0002  0.6116  0.0002  0.0002  0.0002  0.0002  0.0005  ±0.90%  2671062
   · fastcolor        10,865,390.93  0.0001  1.1889  0.0001  0.0001  0.0001  0.0001  0.0002  ±0.50%  5432696   fastest
   ✓ toRgbString (2) 7394ms
     name                        hz     min     max    mean     p75     p99    p995    p999     rme   samples
   · @ctrl/tinycolor  17,450,610.85  0.0000  0.0307  0.0001  0.0001  0.0001  0.0001  0.0001  ±0.03%   8725306
   · fastcolor        20,120,086.75  0.0000  0.7499  0.0000  0.0001  0.0001  0.0001  0.0001  ±0.29%  10060044   fastest

If you add some blank lines between cases, it should be more readable:

   ✓ setAlpha (2) 7444ms
     name                        hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · @ctrl/tinycolor  18,716,735.25  0.0000  0.0122  0.0001  0.0001  0.0001  0.0001  0.0001  ±0.02%  9358368
   · fastcolor        19,874,881.13  0.0000  0.0291  0.0001  0.0001  0.0001  0.0001  0.0001  ±0.03%  9937441   fastest

   ✓ toHexString (2) 3935ms
     name                        hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · @ctrl/tinycolor   5,342,122.96  0.0002  0.6116  0.0002  0.0002  0.0002  0.0002  0.0005  ±0.90%  2671062
   · fastcolor        10,865,390.93  0.0001  1.1889  0.0001  0.0001  0.0001  0.0001  0.0002  ±0.50%  5432696   fastest

   ✓ toRgbString (2) 7394ms
     name                        hz     min     max    mean     p75     p99    p995    p999     rme   samples
   · @ctrl/tinycolor  17,450,610.85  0.0000  0.0307  0.0001  0.0001  0.0001  0.0001  0.0001  ±0.03%   8725306
   · fastcolor        20,120,086.75  0.0000  0.7499  0.0000  0.0001  0.0001  0.0001  0.0001  ±0.29%  10060044   fastest

Reproduction

  1. git clone https://github.com/guoyunhe/fastcolor
  2. npm run bench

System Info

System:
    OS: Linux 6.9 openSUSE Tumbleweed 20240613
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 17.50 GB / 31.27 GB
    Container: Yes
    Shell: 5.2.26 - /bin/bash
  Binaries:
    Node: 21.7.3 - /usr/bin/node
    npm: 10.5.0 - /usr/bin/npm
    pnpm: 9.1.3 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chromium: 125.0.6422.141
  npmPackages:
    vitest: ^1.6.0 => 1.6.0

Used Package Manager

pnpm

Validations

@sheremet-va sheremet-va added p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome feat: benchmark Issues and PRs related to the benchmark feature and removed pending triage labels Jun 16, 2024
@AriPerkkio
Copy link
Member

If you add some blank lines between cases, it should be more readable:

This will be fixed in #7019, here's example:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: benchmark Issues and PRs related to the benchmark feature p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants