Greetings, Symfonians.

I know that there is some difference of opinion within the Symfony world about making controllers ContainerAware vs making them fully injected services. There's decent arguments both directions. We're discussing that self-same issue in Drupal right now:

http://drupal.org/node/1915774

Generally, there seems to be a sense that making them services would be "better". However, one concern we have there is the scalability of the DI Container. We're using a PHP compiled container, which from previous conversations Lukas Smith has told me should scale fine to a thousand or so services before you need to start worrying.

Of course, "about a thousand" is a reasonable approximation for the number of controllers a small Drupal site has[1]. (A powerful and complex administration system means lots of pages, which means lots of controllers.) That means if we establish a pattern of always making controllers services, rather than ContainerAware, we will run into the point where we have to start worrying about the Container's scalability with just Drupal core. That's before getting into contributed modules, which a typical site has in the dozens. And then there's all of the "real" services that we will have. Then there's EventSubscribers, which are registered as services.

That makes the potential scalability of the Container a rather pressing question for us.

Does anyone have any hard data on just how far the Container will scale before compiling it becomes a memory or CPU hog, or the runtime parsing cost gets too big to handle, etc? Just how far have people pushed the Container before it fell over? We're going to be pushing it pretty far, so want to make sure it won't fall over. :-)

(And if you have more direct thoughts on ContainerAware controllers vs. controller services, please do weigh in on the issue above.)


[1] Technically they won't be controllers per se, but content callbacks that will be called from one of a small number of controllers. The scalability question is the same either way.

--Larry Garfield

--
--
If you want to report a vulnerability issue on Symfony, please read the 
procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
--- You received this message because you are subscribed to the Google Groups "Symfony developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to symfony-devs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to