id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
1075,Massive speedup to PageIndex action,skrap,unassigned,"A pageindex request takes 18 seconds on my machine.  I did some profiling, and it's happening because we're running a existsPage() call on each page link as we generate it.  My wiki is massive, so this results in thousands of individual queries to the pages table in the DB.  In this case, this check is unnecessary, as we just got the page name out or the DB, so it presumably still exists.

I wrote a patch to address this, which adds an additional optional parameter to Wakka::Link() to avoid the existsPage check.  This takes the pageindex generation time down to < 1s on my machine.

diff -r /tmp/Wikka-1.3.1/libs/Wakka.class.php ./libs/Wakka.class.php
2284a2285
>      * @param   boolean $assumePageExists optional:
2288c2289
< 	function Link($tag, $handler='', $text='', $track=TRUE, $escapeText=TRUE, $title='', $class='')
---
> 	function Link($tag, $handler='', $text='', $track=TRUE, $escapeText=TRUE, $title='', $class='', $assumePageExists=FALSE)
2345c2346
< 			if (!$this->existsPage($tag))
---
> 			if (!$assumePageExists && !$this->existsPage($tag))
diff -r /tmp/Wikka-1.3.1/actions/pageindex/pageindex.php ./actions/pageindex/pageindex.php
104c104
<                 $index_output .= $this->Link($page['tag']);
---
>                 $index_output .= $this->Link($page['tag'],'','',TRUE,TRUE,'','',TRUE);
",defect,closed,normal,1.3.2,actions,1.3,normal,fixed,,
