-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
perf: optimize client builds #643
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brisa-adapter-vercel
brisa-pandacss
brisa-tailwindcss
brisa
create-brisa
www
commit: |
aralroca
force-pushed
the
aralroca/wc-build-optimizations
branch
3 times, most recently
from
November 24, 2024 15:30
ef4d111
to
3b6be47
Compare
aralroca
changed the title
perf: optimize client builds [WIP]
perf: optimize client builds
Nov 28, 2024
aralroca
force-pushed
the
aralroca/wc-build-optimizations
branch
from
November 30, 2024 19:28
5d4950b
to
8b6caae
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related #162
Related #556
Finally the PR is ready 🔥
The improvement is not as much as I thought, but it is a good step. Good parts:
Things to look at if we can look at how to improve:
I noticed that currently what subtracts the most milliseconds are the barrel files we create for the Bun builder to have. Currently this is necessary because Bun needs the files to do the build and these files do not exist previously. To understand the actual process; first we build the server and in this step we analyze which Web Components each page needs (or not). Then for all the pages that have Web Components a temporary file is generated with the imports of the web components so that the client build takes them into account as entrypoints and resolves the dependencies and generates the files that the client pages need.
Only if we can avoid this step in the future and create the barrel files directly for use in runtime without the step of going through fopen, then we will improve about 40% of the current time.
Results
hardware used: 23.6.0 arm64 arm
note: all pages have server and client code (because only server without client code are faster)
Before:
Now: