16 lines
590 B
JavaScript
16 lines
590 B
JavaScript
|
#!/usr/bin/env node
|
||
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
const js_1 = require("../src/js");
|
||
|
const utils_1 = require("../src/js/cli/utils");
|
||
|
const maxP = 5;
|
||
|
for (let p = 0; p <= maxP; p++) {
|
||
|
const size = Math.pow(10, p);
|
||
|
const project = js_1.SqProject.create();
|
||
|
project.setSource("main", `List.upTo(1, ${size}) |> map({|x| List.upTo(1, 100) |> reduce(0, {|a,b|a+b})})`);
|
||
|
const time = (0, utils_1.measure)(() => {
|
||
|
project.run("main");
|
||
|
});
|
||
|
console.log(`1e${p}`, "\t", time);
|
||
|
}
|
||
|
//# sourceMappingURL=bench-map-reduce.js.map
|