Skip to content
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

Rough draft of bundling sourcemaps and original sources #253

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

niloc132
Copy link
Member

This will cost extra CPU time, but save on IO time and disk space, which is likely a net win for most builds. This is a first draft, which appears to work as expected (sourcemaps function correctly, vastly smaller output in BUNDLE_JAR), but doesn't yet fully reduce the number of copies we can make, and doesn't avoid copying sourcemap bundles (in cases where js bundles are not copied). There may also be caching issues, where sourcemaps are incorrect not generated or are regenerated.

This will cost extra CPU time, but save on IO time and disk space, which
is likely a net win for most builds. This is a first draft, which
appears to work as expected (sourcemaps function correctly, vastly
smaller output in BUNDLE_JAR), but doesn't yet fully reduce the number
of copies we can make, and doesn't avoid copying sourcemap bundles (in
cases where js bundles are not copied). There may also be caching
issues, where sourcemaps are incorrect not generated or are regenerated.
@niloc132 niloc132 requested a review from treblereel February 15, 2024 02:03
@treblereel
Copy link
Collaborator

@niloc132

I tested this PR, and everything works quite well. Notably, the acceleration of rebuilds is about the same as with my source maps PR, from which I can conclude that any reduction in the number of copied files noticeably speeds up the rebuild.

let's merge it

Copy link
Collaborator

@treblereel treblereel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good for me

@niloc132
Copy link
Member Author

Excellent, that's very encouraging. The work so far prevents only the copy from each bundle jar output into the finished working dir (lots of files from lots of bundles), replaced with reading each file in one bundle when that bundle builds. We can go a bit further by avoiding yet another copy of lots of files when each one bundle builds... should also decrease memory footprint a bit more by avoiding hashing more extra files on disk.

That plus hash names for sourcemaps is most of what remains here, I'll let you know when those next steps are done for another review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants