deno-core adding 40mb overhead
We recently migrated to deno-core from mini_v8 and realized a major increase in the size of the release build. Our core runtime is around 12Mb, on which we expected a 20mb increase because of V8, however with deno core we get around an additional 20mb increase in build size, reaching a total of around 50mb. Anyway we can reduce this?
Link to our work:
https://github.com/tailcallhq/tailcall/pull/1088/files
5 Replies
I wasn't able to find the answer to your question about reducing the build size when using
deno-core
in the official Deno documentation. However, I can provide some general advice based on the information you've given.
When dealing with an increase in build size after migrating to deno-core
, it's important to consider what additional features and dependencies deno-core
might be including compared to mini_v8
. deno-core
is designed to be a minimal snapshot of the Deno runtime, but it still includes essential parts of the Deno infrastructure which could contribute to the size increase.
Since I don't have access to the specifics of your build process or the exact features you are using from deno-core
, I can't provide a tailored solution. However, here are a few general suggestions that might help reduce the build size:
1. Tree Shaking: Ensure that your build process is effectively tree-shaking unused code. This can help eliminate code that isn't actually needed for your application to run.
2. Optimizations: Check if there are any compiler flags or build options that can optimize the build size. Sometimes, different optimization levels can significantly affect the output size.
3. Dependencies: Review the dependencies included in your build. If deno-core
is pulling in additional dependencies that you don't need, see if there's a way to exclude them.
4. Assets: If your project includes assets or other static files, make sure they are compressed and optimized for size.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. Additionally, since you've provided a link to your work, I would recommend reviewing the changes in the pull request to see if thereare any obvious additions that could be contributing to the size increase. If you continue to have concerns about the build size, you might want to reach out to the Deno community or the maintainers of
deno-core
for more specific guidance.You can use
deno_core
without default features which includes a heavy ICU data file@bartlomieju thanks! We were able to reduce it by 7mb for darwin (53mb to 46mb)
GitHub
fix: disable unused flag to reduce build size by amitksingh1490 · P...
Disable unused feature flag in deno-core