Welcome Guest, Not a member yet? Register   Sign In
Best practice for performance with loading helpers
#1

[eluser]Higher Ground Studio[/eluser]
I am loading the url helper a few times and was wondering if anyone knew where it makes sense for performance with auto-loading vs loading in controllers.
#2

[eluser]bretticus[/eluser]
It's pretty simple really. Loading from controllers allows you to load source code applicable to that URL only. Auto-loading source code is a programmers convenience. Many people auto-load the url helper because they plan to use it in every view. Personally, from a mile-high perspective, I don't perceive too much overhead auto-loading a few libs/helpers that are commonly used. If you want grab every ounce of performance out of your scripts, it makes sense to keep the source code down for unused code.
#3

[eluser]cahva[/eluser]
I use PHP 5 autoload(instead of MY_Controller) to extend so I have different base controllers for different situations(for example front and backend controllers) and I load different libraries as I go. Url helper is almost the only one that I autoload as its so used in everywhere.




Theme © iAndrew 2016 - Forum software by © MyBB