Welcome Guest, Not a member yet? Register   Sign In
function preforms much worse on CI
#5

[eluser]idofr[/eluser]
i am indeed trying to count the files in the path, the first 2 readdir's are for the '.'&'..'

i know that the code has nothing to do with CI that is exactly why i find it so odd that just a change of framework causes such a delay.

ok, i've tried your code and indeed it made a difference, unfortunately another function in the code is still quite slow and i can't think of a way to speed it up

Code:
function load_pics($type,$i,$page)            //returns the file names in order
    {
        $path = str_replace("application\models\pic_load.php","JSandProducts\\".$type, __FILE__);
        $files = scandir($path);
        $index = ($page-1)*9 + $i -95;
        if (isset($files[$index]))
            return $files[$index];
        else
            return "";
}


Messages In This Thread
function preforms much worse on CI - by El Forum - 06-02-2011, 01:11 PM
function preforms much worse on CI - by El Forum - 06-02-2011, 03:38 PM
function preforms much worse on CI - by El Forum - 06-02-2011, 03:46 PM
function preforms much worse on CI - by El Forum - 06-02-2011, 04:04 PM
function preforms much worse on CI - by El Forum - 06-02-2011, 04:21 PM
function preforms much worse on CI - by El Forum - 06-02-2011, 11:20 PM
function preforms much worse on CI - by El Forum - 06-03-2011, 02:56 AM
function preforms much worse on CI - by El Forum - 06-03-2011, 04:35 AM
function preforms much worse on CI - by El Forum - 06-03-2011, 05:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB