CodeIgniter Forums
Is this possible? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Is this possible? (/showthread.php?tid=26996)



Is this possible? - El Forum - 01-28-2010

[eluser]Hitesh Chavda[/eluser]
I have a question

If I am not wrong, Every time Someone request a page Codeigniter(almost every framwork) invoke its code and open bunch of class files, php parse it and display output, right?

suppose someone request following file named welcome.php. framwork loads all class file and display output.
Code:
echo "ONLY ONE LINE";


But everytime all the class file are loaded into memory than parser parse it. If this is right, this is not DRY principal.

Can we not do like load all the class one time in memory and when other files request some function then php load it from memory.

May be I look like fool But this is just my thought. Do you really understand what I want to say?


Is this possible? - El Forum - 01-28-2010

[eluser]Colin Williams[/eluser]
You're thinking of a server as a CPU and not a, er, server. There is no open line between the client and the server (at least not until all browsers support Browser Sockets, which is probably more than a decade away).


Is this possible? - El Forum - 01-29-2010

[eluser]Unknown[/eluser]
If your server has eacceletor you will get what you're talking about.

It loads all the classes to memory and saves you about half a time to produce the result.

But if you rebuild loader class and some other classes and put all the engine scripts in one index.php file you will get more then 90% time save. And some memory save although.