Welcome Guest, Not a member yet? Register   Sign In
Performance: Loading many (smaller) views Vs fewer (larger) views
#6

[eluser]dynZack[/eluser]
[quote author="slowgary" date="1283827078"]I played around a bit as well. I created 100 blank views, then ran the following code with and without the commented break.
Code:
class Test extends Controller
{
    function index()
    {
        $this->output->enable_profiler(TRUE);

        $test = array(
            'test10' => 'apples',
            'test11' => 'apples',
            'test12' => 'apples',
            'test13' => 'apples',
            'test14' => 'apples',
            'test15' => 'apples',
            'test16' => 'apples',
            'test17' => 'apples',
            'test18' => 'apples',
            'test19' => 'apples'
        );

        for($i = 0; $i < 100; $i++)
        {
            $this->load->view('test/test'.$i, $test);
            // break;
        }
    }
}

The total execution time is below:
0.0155 - 0.0160 for one loop
0.0235 - 0.0240 for 100 loops

So it looks like each view() call is taking less than 1 thousandth of a second. Obviously the amount of time will depend on how fast your server is, but I think in your case dynZack, the extra calls are moot.

I hope this helps.[/quote]


Thanks for that. Really helpful


Messages In This Thread
Performance: Loading many (smaller) views Vs fewer (larger) views - by El Forum - 11-27-2010, 02:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB