Try to fix release publishing on registry
[poolifier.git] / benchmarks / internal / bench.js
index 2ad7f22c5e47ec7827366ed3c95b21a3402c06cf..bdb2f614a780e0f78f86b4ff2a2063c65ce283b7 100644 (file)
@@ -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 })
 }