I have a string of about 6350268 characters and when I output them to the browser it takes up at least 700ms, but usually 900ms to 1000ms of extra execution time to output it.
The generation only takes up about 300ms, but together it's almost a whole second.
Is there a way to speed up echo output? or is it limited by the browser to which it is outputted?
// What this code does is take about 20.000 urls in the database and
// and transform it into a collapsable folder tree
// this process generates about 6300000 characters in about 300ms.
$this->benchmark->mark('code_start');
$query = $this->db->query("SELECT `url` from `site_pages` WHERE `url` not like '' order by `url` ASC");
$arr = array();
foreach($query->result() as $result)
{
$arr[$result->url] = $result->url;
}
$tree = $this->explodeTree($arr,'/',true);
$str = $this->plotTree($tree);
echo $str;
$this->benchmark->mark('code_end');
echo $this->benchmark->elapsed_time('code_start', 'code_end');
echo "<P>done";