[wp-hackers] Profiling Wordpress filters and actions
Austin Matzko
if.website at gmail.com
Thu Jan 8 15:27:54 GMT 2009
On Wed, Jan 7, 2009 at 9:02 PM, Johan Eenfeldt <johan.eenfeldt at gmail.com> wrote:
> The most expensive ones are, without any competition, the ones in
> (among other places) 'the_content' and 'comment_text'. They take 6.2%
> of total time on homepage, 62.2% on a page with 400 comments (this
> used to be ~82% until someone changed convert_smilies() :) ).
>
> If you want spend some effort optimizing things and make it count this
> is the list: wptexturize 18%, wpautop 17%, make_clickable 14%,
> convert_smilies 10% (used to be 55%).
Since comments are not usually edited that much it makes sense to
apply the formatting functions to the comment text *before* it's saved
(using the 'pre_comment_content' filter perhaps) rather than on
rendering. That would take care of a big chunk of those performance
issues.
Of course, changing this in core would involve some tricky
backwards-compatibility issues.
More information about the wp-hackers
mailing list