Optimize package for lambda
mledom opened this issue ยท 6 comments
I'm submitting a ...
- bug report
- [] feature request
- question about the decisions made in the repository
- question about how to use this project
Summary
We are using the module for our lambda functions and the size of the package when deployed is over 42Mb. Are there some dependencies that could be move to dev depends and minimized code?
Other information
Running node 10.10 in AWS Lambda
Hi @mledom , thanks for reporting this! This is an issue we're aware of, from our own usage with Netlify Functions (internally Lambda).
I'm going to dedicate a bit of time to look into this, and see if there is any optimisation we can do to lower the package size. I'll keep you updated ๐
Hi @mledom , I've just merged in #18, which adds minification of the compiled protos directory. The details can be found in the PR writeup. Subsequently, we've released a new google-ads-node version, 1.12.1.
This is a good first step and brings down the package size significantly, but we think there is more we can do to bring the overall package size down. Stay tuned for more ๐
An update on this: we've had some ideas on how we might be able to further reduce the package size, ranging from releasing a "google-ads-node-lite" (think of an alpine release), to compiling protos on the fly.
I'll make sure to keep this issue updated when we decide on our next steps.
Hi @kritzware what do you mean with compiling protos on the fly ?
@kritzware any progress or ideas on bringing the package size down? It looks like the bulk of it sits inside src
and the large number of files in both v7
and v8
. Protos folder is also quite large, but not comparable to the other two. Maybe a toned down version of the library (lite) or a way for developers to pick and choose which modules they install/use would be an interesting solution.
@sweetanalytics See #99 for a solution - this is a problem with the upstream proto builder Google uses. I recommend using another proto builder and gRPC library on top of those protos