Proof of concept: Transpile in workers #1082
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proof of concept for #1052.
The code is terrible! Let's not talk about that!
What it does:
babel-core/register
-like behavior into AVA itselfCaveats:
babel-core/register
-like behavior just assumes any nonnode_modules
file needs transpilation, using non-test-related Babel setupHere's some unscientific comparisons comparing
x690@master
andx690@test-against-src
(which requires thebabel-core/register
-like behavior) with AVAmaster
(6165a23). Does not include bundle generation time.Command used is
time ./node_modules/.bin/ava --verbose
with Node.js v6.8.1. For themaster
no cache tests,BABEL_DISABLE_CACHE=true
is set.master
cache tests are run twice with Babel's cache enabled, capturing the second result.x690@master
x690@test-against-src
master
no cachemaster
cachepoc
no cachepoc
cacheObservations:
poc
is slower when sources do not need to be transpiled. Presumably that's due to the remaining overhead of loading Babel in each worker, and the cost of transpilation itselfmaster
(except that there is no cache validation in thepoc
…)x690@test-against-src
case 18.94s versus 13.50s)Takeaways:
Thoughts?