time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

bench-map.js (653B)


      1 #!/usr/bin/env node
      2 import { SqProject } from "../index.js";
      3 import { measure } from "../cli/utils.js";
      4 const maxP = 7;
      5 async function main() {
      6     for (let p = 0; p <= maxP; p++) {
      7         const size = Math.pow(10, p);
      8         const project = SqProject.create();
      9         project.setSource("list", `l = List.upTo(1,${size})`);
     10         project.run("list");
     11         project.setSource("map", "l -> map({|x| x})");
     12         project.setContinues("map", ["list"]);
     13         const time = await measure(async () => {
     14             await project.run("map");
     15         });
     16         console.log(`1e${p}`, "\t", time);
     17     }
     18 }
     19 main();
     20 //# sourceMappingURL=bench-map.js.map