I just had some time so I looked at the code some more… How about “caching” some values in different functions… for example:
In Config.php you can find the following function
function system_url()
{
$x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH));
return $this->slash_item('base_url').end($x).'/';
}
by replacing it with something like
function system_url()
{
static $system;
if (!isset($system))
{
$x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH));
$system = $this->slash_item('base_url').end($x).'/';
return $system;
}
else
return $system;
}
we only have to execute the RegEx once… (of course it would be better to remove the RegEx if possible, but using static vars (or the $_GLOBALS array) to store some values could be an option if we can’t remove the RegEx easily and if the value doesn’t change during the execution of CI)
