Skip to content

esm: improve performance & tidy tests#43784

Merged
aduh95 merged 15 commits into
nodejs:mainfrom
JakobJingleheimer:esm/tidy-esm-tests
Jul 29, 2022
Merged

esm: improve performance & tidy tests#43784
aduh95 merged 15 commits into
nodejs:mainfrom
JakobJingleheimer:esm/tidy-esm-tests

Conversation

@JakobJingleheimer
Copy link
Copy Markdown
Member

@JakobJingleheimer JakobJingleheimer commented Jul 11, 2022

This standardises the setup of ESM tests and improves performance by parallelising case runs using a promise wrapper around async spawn.

I originally started out using chaining for parallelisation, but switched to node:test to avoid a bajillion .then()s. As .then()s, the performance improvement was obvious.

I'm not sure how to get a truly apples-to-apples comparison: ./tools/test.py -J es-module doesn't benefit from node:test's parallelisation. I manually checked one of the largest tests, and the improvement is quite stark:

$> time ./node ./test/es-module/test-esm-loader-chaining.mjs
When Duration
Before 0m1.168s
After 0m0.442s

Note to reviewers: enabling Hide whitespace reduces the diff by about a third.

cc @nodejs/loaders

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. loaders Issues and PRs related to ES module loaders test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants