node/benchmark/esm
Joyee Cheung 275215f7bc benchmark: use typescript for import cjs benchmark
The original benchmark uses a not very realistic fixture (it has
a huge try-catch block that would throw on the first line and then
export at the end, hardly representative of real-world code).
Also, it measures the entire import including evaluation, not just
parsing. This updates the name to import-cjs to be more accurate,
and use the typescript.js as the fixture which has been reported
to be slow to import, leading users to use require() to work around
the peformance impact. It splits the measurement into two different
types: parsing CJS for the first time (where the overhead of
loading the lexer makes a difference) and parsing CJS after the
lexer has been loaded.

PR-URL: https://github.com/nodejs/node/pull/60663
Refs: https://github.com/nodejs/node/issues/59913
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-11-12 18:34:59 +00:00
..
detect-esm-syntax.js benchmark: rewrite detect-esm-syntax benchmark 2024-10-09 14:16:01 +00:00
esm-legacyMainResolve.js benchmark: use tmpdir.resolve() 2023-08-30 09:55:20 +00:00
esm-loader-defaultResolve.js benchmark: use tmpdir.resolve() 2023-08-30 09:55:20 +00:00
esm-loader-import.js test,benchmark: use tmpdir.fileURL() 2023-08-21 16:42:03 +00:00
import-cjs.js benchmark: use typescript for import cjs benchmark 2025-11-12 18:34:59 +00:00
import-esm-reload.js benchmark: add vm.SourceTextModule benchmark 2025-10-15 11:41:53 +00:00
import-meta.js benchmark: focus on import.meta intialization in import-meta benchmark 2025-11-08 16:33:34 +00:00
require-esm.js benchmark: add require-esm benchmark 2024-07-11 18:59:30 +00:00