X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.js;h=bdb2f614a780e0f78f86b4ff2a2063c65ce283b7;hb=4f4ae1cb3c33228a023ea599c2648268d15e6c0f;hp=c3db71651a1e84b333490ded1bcd10f29650ff41;hpb=ff5e76e152be8540cba8118bb4e2b9da314dfff5;p=poolifier.git diff --git a/benchmarks/internal/bench.js b/benchmarks/internal/bench.js index c3db7165..bdb2f614 100644 --- a/benchmarks/internal/bench.js +++ b/benchmarks/internal/bench.js @@ -3,20 +3,22 @@ const { dynamicClusterTest, dynamicClusterTestLessRecentlyUsed } = require('./cluster/dynamic') -const { fixedClusterTest } = require('./cluster/fixed') +const { + fixedClusterTest, + fixedClusterTestLessRecentlyUsed +} = require('./cluster/fixed') const { dynamicThreadTest, dynamicThreadTestLessRecentlyUsed } = require('./thread/dynamic') -const { fixedThreadTest } = require('./thread/fixed') +const { + fixedThreadTest, + fixedThreadTestLessRecentlyUsed +} = require('./thread/fixed') +const { LIST_FORMATTER } = require('./benchmark-utils') const suite = new Benchmark.Suite('poolifier') -const LIST_FORMATTER = new Intl.ListFormat('en-US', { - style: 'long', - type: 'conjunction' -}) - // Wait some seconds before start, pools need to load threads !!! setTimeout(async () => { test() @@ -25,18 +27,24 @@ setTimeout(async () => { async function test () { // Add tests suite - .add('Poolifier:Static:ThreadPool', async function () { + .add('Poolifier:Fixed:ThreadPool', async function () { await fixedThreadTest() }) + .add('Poolifier:Fixed:ThreadPool:LessRecentlyUsed', async function () { + await fixedThreadTestLessRecentlyUsed() + }) .add('Poolifier:Dynamic:ThreadPool', async function () { await dynamicThreadTest() }) .add('Poolifier:Dynamic:ThreadPool:LessRecentlyUsed', async function () { await dynamicThreadTestLessRecentlyUsed() }) - .add('Poolifier:Static:ClusterPool', async function () { + .add('Poolifier:Fixed:ClusterPool', async function () { await fixedClusterTest() }) + .add('Poolifier:Fixed:ClusterPool:LessRecentlyUsed', async function () { + await fixedClusterTestLessRecentlyUsed() + }) .add('Poolifier:Dynamic:ClusterPool', async function () { await dynamicClusterTest() }) @@ -55,5 +63,5 @@ async function test () { // eslint-disable-next-line no-process-exit process.exit() }) - .run({ async: true, queued: true }) + .run({ async: true }) }