-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cacheDirectory babel-loader #5436
cacheDirectory babel-loader #5436
Conversation
✅ Deploy Preview for redwoodjs-docs canceled.
|
Some reference plugins I used for profiling -- note the built in profiler does NOT work -- throws when dropped into chrome debugger. @dac09 mentioned it was neever updated to work with webpack 5.
|
Running SMB -- where do the other 10 s go?
|
Hey @MichaelrMentele - appreciate all the effort into these PRs - but something I wanted to point out - the jest tests don't actually use webpack - and therefore doesn't use babel loader. Yes I would say the two files that are most likely the culprits for the jest initialisation time are these: In particular, I have a feeling it may be the loading of the project mocks in the beforeEach in jest setup. |
@dac09 Michael mentioned in the OP that this was for build, not for test. And it seems that it does improve build time, even if it’s a little. We’ve certainly merged smaller performance gains before. So thoughts on getting this one in? It's not critical, but it'd nice to bring this one to a close one way or another. |
@MichaelrMentele I discussed with @dac09 the other day. We're going to close this one cause we're not sure that the possible performance gain is worth the change webpack config, which just comes with some unknowns for us. If we had more tests around our webpack config, we'd be more confident in this. Sorry that this was open for so long—thanks for taking the time to do the research you did and contribute! |
Noticed when investigating #5231 that we aren't caching transpilation when using the
babel-loader
plugin that glues together webpack and babel.The impact of this is that we are potentially retranspiling ALL of our files when often some tiny fraction of them actually need to be transpiled (when we call bebel with webpack through babel-loader)
Seems to have a net O(10%) speed up for net build time for the redwood web side. Course
babel-loader
itself is only one part of that process -- according to the docs this should give an O(2x) speed boost when cached so working backwards sounds like our overall transpilation time is about ~6 s or roughly 20% of overall build time -- for a relatively small redwood project on my machine.Redwood Build Time Before:
Redwood Build Time After: