[possible optimization] Info Request about loading views - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [possible optimization] Info Request about loading views (/showthread.php?tid=1987) |
[possible optimization] Info Request about loading views - El Forum - 07-10-2007 [eluser]marcalj[/eluser] Hello everybody! I'm worried about the proceeding of loading views. I see that the loader is duplicating a lot of data in the proceeding. I don't know exactly how internally PHP manage the memory. Probably would be better to use more references creating new variables or catching it in the function definition. Example: In Loader.php (page 551) replace Code: // Set the default data variables Code: foreach( array('view', 'vars', 'path', 'return') as $val ) This is one example of how to increase performance. Do I am right? I find confusing the loader method because in my controllers I send a lot of "memory" to views: Code: $this->load->view( "example_view", $this->vAlotOfData ); What do you think? Have a nice day [possible optimization] Info Request about loading views - El Forum - 07-10-2007 [eluser]Mirage[/eluser] I think the 'referencing' is overrated and quite misunderstood. PHP doesn't 'copy' your data by default in PHP4+. This only happens when you actually 'modify' the item. So if the goal is not to modify the result of a function, or have a function modify a passed parameter, or having access to a shared object, passing/assigning byref doesn't give you a measurable benefit at all. |