You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the following, I am using nodeLinker: node-modules.
Currently, for a Dockerfile, I run yarn workspaces focus A B C to install all dependencies for workspaces A, B, and C. The reason for A and B being included is that they have devDependencies that are shared by C, D, E, etc.
Then, I run yarn workspace C build to build using devDependencies.
Finally, I run yarn workspaces focus C --production to narrow down to non-devDependencies.
I do this to ensure we have the build-related dependencies, build using them, and then slim down the dependencies to only what is used by the application in production.
Something I noticed is the difference in time it takes for each of these:
#14 [8/11] RUN yarn workspaces focus A B C
--
201 | #14 4.633 ➤ YN0000: ┌ Resolution step
206 | #14 5.381 ➤ YN0000: └ Completed in 0s 746ms
207 | #14 5.381 ➤ YN0000: ┌ Fetch step
208 | #14 10.45 ➤ YN0000: └ Completed in 5s 65ms
209 | #14 10.45 ➤ YN0000: ┌ Link step
214 | #14 167.2 ➤ YN0000: └ Completed in 2m 37s
215 | #14 167.8 ➤ YN0000: Done with warnings in 2m 44s
216 | #14 DONE 168.5s
217 |
218 | #15 [9/11] RUN yarn workspace C build
219 | #15 DONE 75.7s
220 |
221 | #16 [10/11] RUN yarn workspaces focus C --production
222 | #16 7.286 ➤ YN0000: ┌ Resolution step
227 | #16 8.157 ➤ YN0000: └ Completed in 0s 848ms
228 | #16 8.157 ➤ YN0000: ┌ Fetch step
229 | #16 10.52 ➤ YN0000: └ Completed in 2s 381ms
230 | #16 10.52 ➤ YN0000: ┌ Link step
231 | #16 722.0 ➤ YN0000: └ Completed in 11m 52s
232 | #16 722.1 ➤ YN0000: Done with warnings in 11m 55s
233 | #16 DONE 722.4s
It takes over four times longer to complete yarn workspaces focus C --production than yarn workspaces focus A B C. It seems like most of that comes down to the linking step. Just curious if this is normal, due to removing links from the previous yarn workspaces focus or if there is some optimization that can be done?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For the following, I am using
nodeLinker: node-modules
.Currently, for a Dockerfile, I run
yarn workspaces focus A B C
to install all dependencies for workspaces A, B, and C. The reason for A and B being included is that they have devDependencies that are shared by C, D, E, etc.Then, I run
yarn workspace C build
to build using devDependencies.Finally, I run
yarn workspaces focus C --production
to narrow down to non-devDependencies.I do this to ensure we have the build-related dependencies, build using them, and then slim down the dependencies to only what is used by the application in production.
Something I noticed is the difference in time it takes for each of these:
It takes over four times longer to complete
yarn workspaces focus C --production
thanyarn workspaces focus A B C
. It seems like most of that comes down to the linking step. Just curious if this is normal, due to removing links from the previousyarn workspaces focus
or if there is some optimization that can be done?Beta Was this translation helpful? Give feedback.
All reactions