diff --git a/bench/ffi/sqlite.bun.ts b/bench/ffi/sqlite.bun.ts index c91b038a..4c44921c 100644 --- a/bench/ffi/sqlite.bun.ts +++ b/bench/ffi/sqlite.bun.ts @@ -155,23 +155,8 @@ function run(): number[] { return result; } -// console.log(`result: ${run()}`); - -// based on https://github.com/littledivy/blazing-fast-ffi-talk/blob/main/bench.mjs -const total = 10; -const runs = 100_000; - -let sum = 0; -const bench = () => { - const start = performance.now(); - for (let i = 0; i < runs; i++) run(); - const elapsed = Math.floor(performance.now() - start); - const rate = Math.floor(runs / (elapsed / 1000)); - sum += rate; -}; - -for (let i = 0; i < total; i++) { - bench(); -} +const runs = 10_000; +const start = performance.now(); +for (let i = 0; i < runs; i++) run(); -console.log(sum / total); \ No newline at end of file +console.log(((performance.now() - start)).toFixed(10)); \ No newline at end of file diff --git a/bench/ffi/sqlite.deno.ts b/bench/ffi/sqlite.deno.ts index 553a6843..205f7d36 100644 --- a/bench/ffi/sqlite.deno.ts +++ b/bench/ffi/sqlite.deno.ts @@ -144,21 +144,8 @@ function run(): number[] { return result; } -// console.log(`result: ${run()}`); - -// based on https://github.com/littledivy/blazing-fast-ffi-talk/blob/main/bench.mjs -const total = 10; -const runs = 100_000; - -let sum = 0; -const bench = () => { - const start = performance.now(); - for (let i = 0; i < runs; i++) run(); - const elapsed = Math.floor(performance.now() - start); - const rate = Math.floor(runs / (elapsed / 1000)); - sum += rate; -}; - -for (let i = 0; i < total; i++) bench(); +const runs = 10_000; +const start = performance.now(); +for (let i = 0; i < runs; i++) run(); -console.log(sum / total); \ No newline at end of file +console.log(((performance.now() - start)).toFixed(10)); \ No newline at end of file diff --git a/bench/ffi/sqlite.porf.ts b/bench/ffi/sqlite.porf.ts index 188be3ac..dc468be9 100644 --- a/bench/ffi/sqlite.porf.ts +++ b/bench/ffi/sqlite.porf.ts @@ -136,23 +136,8 @@ const run = (): number[] => { return result; }; -// Porffor.print(run()); Porffor.printStatic('\n'); - -// based on https://github.com/littledivy/blazing-fast-ffi-talk/blob/main/bench.mjs -const total = 10; -const runs = 100_000; - -let sum = 0; -const bench = () => { - const start = performance.now(); - for (let i = 0; i < runs; i++) run(); - const elapsed = Math.floor(performance.now() - start); - const rate = Math.floor(runs / (elapsed / 1000)); - sum += rate; -}; - -for (let i = 0; i < total; i++) { - bench(); -} +const runs = 10_000; +const start = performance.now(); +for (let i = 0; i < runs; i++) run(); -console.log(sum / total); \ No newline at end of file +console.log(((performance.now() - start)).toFixed(10)); \ No newline at end of file diff --git a/package.json b/package.json index 311b77ac..9c80955d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "porffor", "description": "An ahead-of-time JavaScript compiler", - "version": "0.56.2", + "version": "0.56.3", "author": "Oliver Medhurst ", "license": "MIT", "scripts": {}, diff --git a/runner/index.js b/runner/index.js index 2ea64345..ce1fca12 100644 --- a/runner/index.js +++ b/runner/index.js @@ -1,6 +1,6 @@ #!/usr/bin/env node import fs from 'node:fs'; -globalThis.version = '0.56.2'; +globalThis.version = '0.56.3'; // deno compat if (typeof process === 'undefined' && typeof Deno !== 'undefined') {