I have tried running the wp-syntax plugin for syntax highlighting. Problem is, it is painfully slow for me, especially on the index page with a bunch of posts at once. I am looking for some advice on possibly speeding it up. I don’t want to abandon it since it has the prettiest output by far.
I am sure it is wp-syntax after a process of elimination. I even know which bit of wp-syntax is the “problem”.
wp-syntax registers 6 filters. “Before” and “After” filters for the_content, the_excerpt and comment_text. The problem is that with my pretty large chunks of code the before filter for the content provide results that take up a lot of time for the corresponding after filter. The problem is compounded on index pages where the total number of lines of code might easily be 10-fold.
I would like to avoid trying to replace the regexp used in those filters. Instead I was wondering if there is a way to make sure that the plugin only parses visible content. I have my index showing the excerpts only and thought that would make a difference but it appears that the whole post gets parsed anyway. Is this standard WP behavior?
If so, is there a variable to check or function to call to find out if the_content will be displayed and should be parsed?
- The topic ‘Speed-up wp-syntax?’ is closed to new replies.