2022-09-18 15:14:32 +00:00
|
|
|
#!/usr/bin/env node
|
2022-09-18 15:18:10 +00:00
|
|
|
import { SqProject } from "@quri/squiggle-lang";
|
2022-09-19 20:55:32 +00:00
|
|
|
import { measure } from "./lib.mjs";
|
2022-09-18 15:14:32 +00:00
|
|
|
|
|
|
|
const maxP = 7;
|
|
|
|
|
|
|
|
for (let p = 0; p <= maxP; p++) {
|
|
|
|
const size = Math.pow(10, p);
|
2022-09-18 15:18:10 +00:00
|
|
|
const project = SqProject.create();
|
2022-09-18 15:14:32 +00:00
|
|
|
project.setSource("list", `l = List.upTo(1,${size})`);
|
|
|
|
project.run("list");
|
|
|
|
project.setSource("map", "l |> map({|x| x})");
|
|
|
|
project.setContinues("map", ["list"]);
|
|
|
|
const time = measure(() => {
|
|
|
|
project.run("map");
|
|
|
|
});
|
|
|
|
console.log(`1e${p}`, "\t", time);
|
|
|
|
}
|