benchmark: rewrite import.meta benchmark · nodejs/node@23f56d8 · GitHub
Skip to content

Commit 23f56d8

Browse files
joyeecheungRafaelGSS
authored andcommitted
benchmark: rewrite import.meta benchmark
This is a ESM benchmark, rewrite it so that we are directly benchmarking the ESM import.meta paths and using number of loads for op/s calculation, instead of doing it in startup benchmarks and nesting number of process/workers spawn for op/s calculation. PR-URL: #50683 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
1 parent aebe2fc commit 23f56d8

4 files changed

Lines changed: 34 additions & 9 deletions

File tree

benchmark/esm/import-meta.js

Lines changed: 32 additions & 0 deletions
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
import assert from 'assert';
2-
assert.ok(import.meta.dirname);
3-
assert.ok(import.meta.filename);
1+
export const dirname = import.meta.dirname;
2+
export const filename = import.meta.filename;

benchmark/fixtures/load-esm-dir-file.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

benchmark/misc/startup.js

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)