Module context settings
Posted 14 March 2012 - 08:56 AM
It just occurred to me that the more modules you have the more modules the system has to run to see if they apply to the current action.
Some run solely on the front-end, some only in admin, and many only when editing pages.
Would it not make sense to have some basic information required for ALL modules and stored in the database so that the system doesn't have to include and run every module to see if it's applicable?
I know there's scope to go crazy with it, but I think that a few basic settings would save a little overhead.
I also know that a few kilobytes never hurt anyone so what's all the fuss about
That's assuming that this is how it works and I'm not missing something obvious.
Posted 14 March 2012 - 09:39 AM
Down the road, there is room for further optimization here. We could have an autoload module that only loads when template is 'admin' or page is X or has parent Y, or any number of things. But this is added complexity for both the user and the module developer. So it's something I'm not sure we need to consider too much until memory issues are a concern. Currently memory is not an issue, even with a lot of autoload modules. But longer term we will benefit from an 'autoload if' type designation for modules, and good to start planning for.
Posted 14 March 2012 - 09:43 AM
I suppose the only issue with those is if they're designed to use selectors and have a lot of data to look through and are being loaded unnecessarily, but then that's probably more to do with the module's design, as if it's built well enough then one of the first checks on one of the first lines of code should be whether you're in the admin or not (if that's a check you need to run in a specific module).
I guess I worry with my own modules more than others
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users