Welcome Guest, Not a member yet? Register   Sign In
Auto Load Model
#1

[eluser]Kiran Dangol[/eluser]
Hi Everybody,

I have a question regarding auto loading models. Will autoload models affect in performance in website?

Thanks in advance.
#2

[eluser]Sagar Ratnaparkhi[/eluser]
This instructing CI to auto load your models into memory. It wont much affect on site performance. But usually its good to keep most used models in autoload (which needed in most of controllers),else get loaded specifically.

Btw. You can use CI's profiler to review performance.
#3

[eluser]Kiran Dangol[/eluser]
Hi Sagar,

Thanks for answer. Now what about library. Will it too affect in speeding?
#4

[eluser]PhilTem[/eluser]
It's not easy to answer, but let's state it like this: If you're running on an old machine and autoload 10 models, 10 libraries, 10 configs, and 10 helpers, it will slow down the webserver thus taking longer to create the page plus you will have less memory available for further requests on your server at the same time.
However, if you're running on a rather new machine with some 2GB of RAM it might not be that horrible to autoload many models, libs, ....
Though anyway it is better to load models on a load-when-needed paradigm. Makes your code run faster plus it's just more intuitive, that you load stuff only when you need it thus keeping resources available for other tasks Wink
#5

[eluser]Kiran Dangol[/eluser]
Many many thanks to PhilTem. I got clear vision now.
Thank you a lot.




Theme © iAndrew 2016 - Forum software by © MyBB