[pmwiki-devel] Small optimisation

Petko Yotov 5ko at 5ko.fr
Sun Jan 11 06:56:34 CST 2015


If the markup rules have not changed in the meantime, they are not 
rebuilt, the existing array is simply returned, so it shouldn't be 
noticeably slower.

It is possible that a markup rule returns not HTML but other wiki markup 
that needs to be re-processed, in that case the markup rules will be 
re-applied from the beginning.

Also, some recipes enable markup rules conditionally depending on other 
markup found in the page.

Petko

On 2015-01-11 13:19, Omar Cornut wrote:
> This line:
> 
>   $markrules = BuildMarkupRules();
> 
> Can be moved outside of the loop. It happens to be constant an
> unmodified for the whole loop and building the rules is slow.
> 
> On our server with our rules and for a large listing it saved 2
> seconds (out of 6.. still too slow but better).




More information about the pmwiki-devel mailing list