Welcome Guest, Not a member yet? Register   Sign In
When should I autoload a library?
#1

[eluser]nyxynyx[/eluser]
Hi, I'm wondering when I should autoload libraries and when should I load it in the controller when required? If I use a particular library on 50% of the pages viewed daily, should I autoload it? Is there a significant performance impact of autoloading libraries? Sorry I'm new to this Smile
#2

[eluser]InsiteFX[/eluser]
The impact would be memory usage.

I usally autoload the databse and session libraries.

If you are using the library a lot then yes I would autoload it, but you can always load them on demand!

InsiteFX
#3

[eluser]LinkFox[/eluser]
If you're using it all over your application then autoload it, I.E Session, however things like form_validation would only really be used on pages with forms so should be loaded when you need it.

I'd say only autoload if 60-70% of your controllers require the library/helper etc, but its a personal preference and its best to learn by tweaking really.

Hope this helps

Regards

David




Theme © iAndrew 2016 - Forum software by © MyBB