Improve packaging performance
See original GitHub issue_Excerpt from: https://github.com/serverless/serverless/issues/6580_
While bigger packaging refactor is scheduled, it appears we can improve significantly our current packing logic in place with following steps:
Implementation proposal
- (if
package.excludeDevDepencies: true
) Resolve all devDependencies, and coin their paths innode_modules
(take into account https://github.com/serverless/serverless/issues/4358 error case) - Resolve all files in a service folder (if
package.excludeDevDepencies: true
avoid traversing into dev dependencies) - To ensure better performance construct logic with callbacks not promises. - Show warning if
symlinks
are approached (we may consider adding support for them in next PR) - Filter obtained files list against eventual package patterns, but intelligently, do not test to be included filenames against include patterns, and do not test excluded filenames against exclude patterns.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (14 by maintainers)
Top Results From Across the Web
5 Ways to Improve Your Packaging Efficiency - Pollock Orora
Consider including challenges with performance-based incentives to increase productivity even further. There you have a mini packaging efficiency audit.
Read more >Beyond Protection: 4 Ways Packaging Improves Performance ...
Time efficiencies: Time is valuable and shouldn't be spent struggling with packaging. Better packaging design makes products easier for ...
Read more >3 Key Steps to Improving Packaging Efficiency - Chainalytics
Step #1: Understand your packaging process. Taking a deep dive into your packaging operation allows you to identify where productivity issues ...
Read more >Improve packaging performance - Nestlé Central & West Africa
We work to optimise our packaging to minimise resource use; use more materials from sustainably managed renewable resources; support initiatives to recycle or ......
Read more >4 ways to improve packaging line performance with Big Data ...
4 ways to improve packaging line performance with Big Data and analytics · 1. Learning from the past for a better future ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I recently experienced a performance issue related to this when packaging my project. In serverless.yml, we specify:
This disables the default behaviour of including all files in the current directory. However, globby is only passed
params.include
, notparams.exclude
. So, globby will return all files in the project directory only for micromatch to later filter out most of them. This means that usingexclude: '**'
instead ofinclude: '!**'
has a big performance impact.To fix this, globby needs to consider excluded patterns too. The fix for this should be simple: instead of
use
since patterns contains
params.include
and the negation ofparams.exclude
.Yeah @BenLanglois – I’ve got a long comment and suggestion for future packaging tweaks here that also discusses the performance problems you’ve also identified: https://github.com/serverless/serverless/issues/6007#issuecomment-520092329