X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.js;h=bdb2f614a780e0f78f86b4ff2a2063c65ce283b7;hb=5cc8be083661067b1264a751c7090e8e4b5da4d7;hp=2ad7f22c5e47ec7827366ed3c95b21a3402c06cf;hpb=be0676b3936d75f22ce55b0f71a1fb03d008a01c;p=poolifier.git diff --git a/benchmarks/internal/bench.js b/benchmarks/internal/bench.js index 2ad7f22c..bdb2f614 100644 --- a/benchmarks/internal/bench.js +++ b/benchmarks/internal/bench.js @@ -1,15 +1,23 @@ const Benchmark = require('benchmark') -const { dynamicClusterTest } = require('./cluster/dynamic') -const { fixedClusterTest } = require('./cluster/fixed') -const { dynamicThreadTest } = require('./thread/dynamic') -const { fixedThreadTest } = require('./thread/fixed') +const { + dynamicClusterTest, + dynamicClusterTestLessRecentlyUsed +} = require('./cluster/dynamic') +const { + fixedClusterTest, + fixedClusterTestLessRecentlyUsed +} = require('./cluster/fixed') +const { + dynamicThreadTest, + dynamicThreadTestLessRecentlyUsed +} = require('./thread/dynamic') +const { + fixedThreadTest, + fixedThreadTestLessRecentlyUsed +} = require('./thread/fixed') +const { LIST_FORMATTER } = require('./benchmark-utils') -const suite = new Benchmark.Suite() - -const LIST_FORMATTER = new Intl.ListFormat('en-US', { - style: 'long', - type: 'conjunction' -}) +const suite = new Benchmark.Suite('poolifier') // Wait some seconds before start, pools need to load threads !!! setTimeout(async () => { @@ -19,18 +27,30 @@ setTimeout(async () => { async function test () { // Add tests suite - .add('Pioardi:Static:ThreadPool', async function () { + .add('Poolifier:Fixed:ThreadPool', async function () { await fixedThreadTest() }) - .add('Pioardi:Dynamic:ThreadPool', async function () { + .add('Poolifier:Fixed:ThreadPool:LessRecentlyUsed', async function () { + await fixedThreadTestLessRecentlyUsed() + }) + .add('Poolifier:Dynamic:ThreadPool', async function () { await dynamicThreadTest() }) - .add('Pioardi:Static:ClusterPool', async function () { + .add('Poolifier:Dynamic:ThreadPool:LessRecentlyUsed', async function () { + await dynamicThreadTestLessRecentlyUsed() + }) + .add('Poolifier:Fixed:ClusterPool', async function () { await fixedClusterTest() }) - .add('Pioardi:Dynamic:ClusterPool', async function () { + .add('Poolifier:Fixed:ClusterPool:LessRecentlyUsed', async function () { + await fixedClusterTestLessRecentlyUsed() + }) + .add('Poolifier:Dynamic:ClusterPool', async function () { await dynamicClusterTest() }) + .add('Poolifier:Dynamic:ClusterPool:LessRecentlyUsed', async function () { + await dynamicClusterTestLessRecentlyUsed() + }) // Add listeners .on('cycle', function (event) { console.log(event.target.toString()) @@ -43,5 +63,5 @@ async function test () { // eslint-disable-next-line no-process-exit process.exit() }) - .run() + .run({ async: true }) }