-
Notifications
You must be signed in to change notification settings - Fork 98
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
Handling singletons in creation of large plans #373
Comments
Related Pull request: inversify/InversifyJS#1116 |
The fix seems to be having some issues with circular dependencies, trying to fix. |
My approach( caching during the planning phase) seems to cause issues with dynamic bindings. Closing the PR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have a complex application with a huge dependency graph. On startup, when all controllers are initialized at once using inversify-express-utils (container.getAll for controllers) we noticed that the startup takes upward of 5 minutes, with more than 6 GB of memory taken for the plan graph. Most of our bindings are Singleton.
Expected Behavior
container.getAll() should be fast
Current Behavior
container.getAll() takes > 5 minutes, a huge amount of RAM
Possible Solution
in planner.ts, we do not need to create childRequests for singleton Bindings multiple times, as there will be only instance of the object
Will be updating the issue with a pull request
Steps to Reproduce (for bugs)
Context
Speeds up the startup of our application, and reduces startup memory utilization from ~6.5 GB to 600MB
Your Environment
node v11.13.0
inversify 5.0.1
inversify-express-utils 6.3.2
express 4.16.2
Private repo
Stack trace
None
The text was updated successfully, but these errors were encountered: