[wp-trac] [WordPress Trac] #20103: Rewrite get_themes() and other enemies of sanity
WordPress Trac
wp-trac at lists.automattic.com
Fri Feb 24 23:12:14 UTC 2012
#20103: Rewrite get_themes() and other enemies of sanity
--------------------------+------------------------------
Reporter: nacin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 1.5
Severity: normal | Resolution:
Keywords: |
--------------------------+------------------------------
Comment (by nacin):
WP_Themes_List_Table::search_theme() does a sanitize_title_with_dashes()
on every tag of every theme.
This is not necessary. Tags are already hyphen-delimited, or we should be
doing that in get_themes() or get_theme_data() to begin with.
In terms of performance, it's terrible. With the WP.com themes directory
loaded up, search_theme() takes up more than 50% of processing time. 40%
of processing time is spent in sanitize_title_with_dashes().
Simply removing the sanitization (and slightly better branching) results
in a tremendous speed-up. In my working patch, it works out to be 17% of
the processing time with a page that is twice as fast.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20103#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list