Welcome Guest, Not a member yet? Register   Sign In
Advice on views for comments system of very dynamic website
#4

(This post was last modified: 07-16-2015, 10:00 AM by mwhitney.)

(07-16-2015, 06:32 AM)DreamOfSleeping Wrote: So is loading a view in codeigniter not slow performance wise?I suppose because it's called 'loading' it made me think it was something I shouldn't do over and over in a loop.

PHP is reasonably good at optimizing something like this. However, you should evaluate the performance based on real-world examples for your application. It is quite possible that loading the view in a loop will mean repeatedly going to the file system to retrieve the view, then evaluating the PHP in that view every time you go through the loop. That's probably the worst-case scenario you should expect.

You don't want to create some complicated way of avoiding the worst-case scenario until you've evaluated the performance of that scenario to determine whether it's worth the extra effort. I don't know how many times I've run profiler on a slow page expecting to start working on one part of the page to speed things up, only to find that the code on the page which takes up the most execution time is something unrelated.
Reply


Messages In This Thread
RE: Advice on views for comments system of very dynamic website - by mwhitney - 07-16-2015, 10:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB