-// Wait some seconds before start, pools need to load threads !!!
-setTimeout(async () => {
- test()
-}, 3000)
-
-async function test () {
- // Add tests
- suite
- .add('Poolifier:Fixed:ThreadPool', async function () {
- await fixedThreadTest()
- })
- .add('Poolifier:Fixed:ThreadPool:LessRecentlyUsed', async function () {
- await fixedThreadTestLessRecentlyUsed()
- })
- .add('Poolifier:Fixed:ThreadPool:WeightedRoundRobin', async function () {
- await fixedThreadTestWeightedRoundRobin()
- })
- .add('Poolifier:Fixed:ThreadPool:FairShare', async function () {
- await fixedThreadTestFairShare()
- })
- .add('Poolifier:Dynamic:ThreadPool', async function () {
- await dynamicThreadTest()
- })
- .add('Poolifier:Dynamic:ThreadPool:LessRecentlyUsed', async function () {
- await dynamicThreadTestLessRecentlyUsed()
- })
- .add('Poolifier:Dynamic:ThreadPool:WeightedRoundRobin', async function () {
- await dynamicThreadTestWeightedRoundRobin()
- })
- .add('Poolifier:Dynamic:ThreadPool:FairShare', async function () {
- await dynamicThreadTestFairShare()
- })
- .add('Poolifier:Fixed:ClusterPool', async function () {
- await fixedClusterTest()
- })
- .add('Poolifier:Fixed:ClusterPool:LessRecentlyUsed', async function () {
- await fixedClusterTestLessRecentlyUsed()
- })
- .add('Poolifier:Fixed:ClusterPool:WeightedRoundRobin', async function () {
- await fixedClusterTestWeightedRoundRobin
- })
- .add('Poolifier:Fixed:ClusterPool:FairShare', async function () {
- await fixedClusterTestFairShare()
- })
- .add('Poolifier:Dynamic:ClusterPool', async function () {
- await dynamicClusterTest()
- })
- .add('Poolifier:Dynamic:ClusterPool:LessRecentlyUsed', async function () {
- await dynamicClusterTestLessRecentlyUsed()
- })
- .add('Poolifier:Dynamic:ClusterPool:WeightedRoundRobin', async function () {
+Benchmark.suite(
+ 'Poolifier',
+ Benchmark.add('Poolifier:Fixed:ThreadPool', async () => {
+ await fixedThreadTest()
+ }),
+ Benchmark.add('Poolifier:Fixed:ThreadPool:LessRecentlyUsed', async () => {
+ await fixedThreadTestLessRecentlyUsed()
+ }),
+ Benchmark.add('Poolifier:Fixed:ThreadPool:WeightedRoundRobin', async () => {
+ await fixedThreadTestWeightedRoundRobin()
+ }),
+ Benchmark.add('Poolifier:Fixed:ThreadPool:FairShare', async () => {
+ await fixedThreadTestFairShare()
+ }),
+ Benchmark.add('Poolifier:Dynamic:ThreadPool', async () => {
+ await dynamicThreadTest()
+ }),
+ Benchmark.add('Poolifier:Dynamic:ThreadPool:LessRecentlyUsed', async () => {
+ await dynamicThreadTestLessRecentlyUsed()
+ }),
+ Benchmark.add('Poolifier:Dynamic:ThreadPool:WeightedRoundRobin', async () => {
+ await dynamicThreadTestWeightedRoundRobin()
+ }),
+ Benchmark.add('Poolifier:Dynamic:ThreadPool:FairShare', async () => {
+ await dynamicThreadTestFairShare()
+ }),
+ Benchmark.add('Poolifier:Fixed:ClusterPool', async () => {
+ await fixedClusterTest()
+ }),
+ Benchmark.add('Poolifier:Fixed:ClusterPool:LessRecentlyUsed', async () => {
+ await fixedClusterTestLessRecentlyUsed()
+ }),
+ Benchmark.add('Poolifier:Fixed:ClusterPool:WeightedRoundRobin', async () => {
+ await fixedClusterTestWeightedRoundRobin
+ }),
+ Benchmark.add('Poolifier:Fixed:ClusterPool:FairShare', async () => {
+ await fixedClusterTestFairShare()
+ }),
+ Benchmark.add('Poolifier:Dynamic:ClusterPool', async () => {
+ await dynamicClusterTest()
+ }),
+ Benchmark.add('Poolifier:Dynamic:ClusterPool:LessRecentlyUsed', async () => {
+ await dynamicClusterTestLessRecentlyUsed()
+ }),
+ Benchmark.add(
+ 'Poolifier:Dynamic:ClusterPool:WeightedRoundRobin',
+ async () => {