time-to-botec/squiggle/node_modules/@quri/squiggle-lang/dist/scripts/bench-map.js

19 lines
647 B
JavaScript
Raw Normal View History

#!/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 = 7;
for (let p = 0; p <= maxP; p++) {
const size = Math.pow(10, p);
const project = js_1.SqProject.create();
project.setSource("list", `l = List.upTo(1,${size})`);
project.run("list");
project.setSource("map", "l |> map({|x| x})");
project.setContinues("map", ["list"]);
const time = (0, utils_1.measure)(() => {
project.run("map");
});
console.log(`1e${p}`, "\t", time);
}
//# sourceMappingURL=bench-map.js.map