Skip to content
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

[Beta] Module size is too BIG #1240

Closed
fakedob opened this issue Nov 10, 2023 · 5 comments
Closed

[Beta] Module size is too BIG #1240

fakedob opened this issue Nov 10, 2023 · 5 comments

Comments

@fakedob
Copy link

fakedob commented Nov 10, 2023

Hey guys, I have noticed that since I started using the beta, our dev environment, runing on Azure functions, started getting its cold start from 2 seconds, to 30+ seconds. Well, I didnt figured it out straight away and it did took me some time to realise that the new Beta depends on few node modules, specifically the @opentelemetry (as noted in the docs), that allocates around 36mb's os space.
My package.json has only:

"dependencies": {
    "@azure/functions": "^4.0.1",
    "applicationinsights": "^3.0.0-beta.10"
  },

And my node_modules are already 69.5mb...

I understand this is still a beta, but are there any ways of reducing the package size, that you are aware? Are there plans to reduce the size, maybe distribute a compiled standalone version or other technique?

Thanks :)

@paed01
Copy link

paed01 commented Feb 16, 2024

Thumbs up for this. Did some evaluation between patches v2.9.2 and v2.9.3 and the increase in size is exponential. Some dependencies should be optional at best.

v2.9.2

v2 9 2

v2.9.3

v2 9 3

One culprit seems to be the @nevware21 packages.

npm list @nevware21/ts-async
`-- applicationinsights@2.9.3
  `-- @microsoft/applicationinsights-web-snippet@1.1.0
    `-- @microsoft/applicationinsights-common@3.1.0
      `-- @microsoft/applicationinsights-core-js@3.1.0
        `-- @nevware21/ts-async@0.4.0

Considering the extremely slow releases of nodejs apps in Azure Dev Ops, correlating to the number of files, this is getting very annoying.

@MSNev
Copy link

MSNev commented Feb 16, 2024

We have created the following Application Insights Issue to address the inclusion of these dependencies, as they are not actually needed at runtime, once we rework the inclusion we will publish an updated v1.1.1 version.

@paed01
Copy link

paed01 commented Feb 19, 2024

Much better, now it is back to normal sizes.

v2.9.4

v2 9 4

Thank you.

@fakedob I scanned the directories with TreeSize free (Windows) after npm prune --omit=dev

@JacksonWeber
Copy link
Contributor

Closing as the bundle sizes were reduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants