-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.js
42 lines (30 loc) · 1.46 KB
/
benchmark.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use strict';
const path = require('path');
const { spawnSync } = require( 'child_process' );
const ITERATION = 100;
let scriptName = 'convert_stream_method.js';
let pathCSVFile = 'data/CSV/customer-data.csv';
let CSVFileName = path.parse(pathCSVFile).base;
let csvSeparator = ',';
let pathBenchOutputfile = path.join(__dirname, '/data/bench/'+scriptName.split('.js')[0] + '_' + CSVFileName);
console.info(`benchmark starting : ${scriptName}-${CSVFileName}`);
for (let i=0; i < ITERATION; i++) {
const processConvert = spawnSync( 'node', [scriptName, pathCSVFile, csvSeparator, pathBenchOutputfile]);
}
pathCSVFile = 'data/CSV/medium.csv';
CSVFileName = path.parse(pathCSVFile).base;
csvSeparator = ',';
pathBenchOutputfile = path.join(__dirname, '/data/bench/'+scriptName.split('.js')[0] + '_' + CSVFileName);
console.info(`benchmark starting : ${scriptName}-${CSVFileName}`);
for (let i=0; i < ITERATION; i++) {
const processConvert = spawnSync( 'node', [scriptName, pathCSVFile, csvSeparator, pathBenchOutputfile]);
}
pathCSVFile = 'data/CSV/large.csv';
CSVFileName = path.parse(pathCSVFile).base;
csvSeparator = ',';
pathBenchOutputfile = path.join(__dirname, '/data/bench/'+scriptName.split('.js')[0] + '_' + CSVFileName);
console.info(`benchmark starting : ${scriptName}-${CSVFileName}`);
for (let i=0; i < ITERATION; i++) {
const processConvert = spawnSync( 'node', [scriptName, pathCSVFile, csvSeparator, pathBenchOutputfile]);
}
console.info('benchmark finish');