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

FW/1 caches controllers even when DI/1 manages them #276

Closed
seancorfield opened this issue Aug 6, 2014 · 1 comment
Closed

FW/1 caches controllers even when DI/1 manages them #276

seancorfield opened this issue Aug 6, 2014 · 1 comment
Milestone

Comments

@seancorfield
Copy link
Member

If DI/1 (or any other bean factory) is managing the controllers, FW/1 should not cache them, so that just reloading the bean factory will be sufficient to reload the controllers.

@seancorfield seancorfield added this to the 3.0 milestone Aug 6, 2014
@seancorfield
Copy link
Member Author

This is slightly harder than it first looks. If we don't cache the controllers (even from a bean factory) then every access to a controller will take a performance hit (even just looking up beans in a factory can be non-trivial as well as the two structKeyExists() calls and the exclusive lock).

The solution I'm adopting is to flush the FW/1 controller cache whenever the bean factory is set. This should provide the best of both worlds: the fastest possible controller access (as now) with the reloading of controllers (whether managed or not) whenever the bean factory is set.

While I was in there, I observed that getCachedComponent() is only used for controllers now that services are not managed by FW/1 so I was able to simplify the code (removing all the type / types stuff) and that improved the speed a bit! Win!

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

No branches or pull requests

1 participant