Skip to content

Commit ed97be2

Browse files
committed
Add benchmarks
1 parent 9db75ef commit ed97be2

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

JavaScript/7-compare.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
node --nouse-idle-notification --noconcurrent_sweeping --noconcurrent_recompilation --predictable 7-promise.js
4+
node --nouse-idle-notification --noconcurrent_sweeping --noconcurrent_recompilation --predictable 7-functor.js
5+
node --nouse-idle-notification --noconcurrent_sweeping --noconcurrent_recompilation --predictable 7-prototype.js

JavaScript/7-functor.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
global.api = {
4+
metasync: require('metasync')
5+
};
6+
7+
const benchmark = require('./6-benchmark');
8+
const chainFunctor = require('./2-functor');
9+
const test = require('./4-test');
10+
benchmark.do(10000, 'Functor', () => test(chainFunctor));

JavaScript/7-promise.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
global.api = {
4+
metasync: require('metasync')
5+
};
6+
7+
const benchmark = require('./6-benchmark');
8+
const chainPromise = require('./1-promise');
9+
const test = require('./4-test');
10+
benchmark.do(10000, 'Promise', () => test(chainPromise));

JavaScript/7-prototype.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
global.api = {
4+
metasync: require('metasync')
5+
};
6+
7+
const benchmark = require('./6-benchmark');
8+
const chainPrototype = require('./3-prototype');
9+
const test = require('./4-test');
10+
benchmark.do(10000, 'Prototype', () => test(chainPrototype));

0 commit comments

Comments
 (0)