0.0.0-nightly.20220324 • Published 2 years ago

concurrent-benchmark v0.0.0-nightly.20220324

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Work In Progress...

concurrent-benchmark

test lint codeql report-card npm license

Benchmark scripts concurrently.

Description

Right now I am just playing around, but I am planning (maybe) to make something serious in the future.

concurrent-benchmark has the alias cb.

Install

$ yarn global add concurrent-benchmark

Usage

CLI

Let's take fixture.js as an example. It has a setTimeout that waits for 2 seconds.

$ time cb \
    'node fixture.js' \
    'node fixture.js' \
    'node fixture.js' \
    'node fixture.js'

So instead of taking using 1 thread (~8s) we are going to use 4 threads (~2s), one for each command. The output of this will get a few console.logs be something like:

real    0m2.289s
user    0m0.157s
sys     0m0.237s

Where real is the time it took to run the command.

Package

Not yet implemented.

import cb from 'concurrent-benchmark';

cb.run([
  {
    name: 'foo',
    script: 'echo foo',
  },
  {
    name: 'bar',
    script: 'echo bar',
  },
]);