Work In Progress...
Benchmark scripts concurrently.
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
.
$ yarn global add concurrent-benchmark
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.
Not yet implemented.
import cb from 'concurrent-benchmark';
cb.run([
{
name: 'foo',
script: 'echo foo',
},
{
name: 'bar',
script: 'echo bar',
},
]);