[wp-trac] [WordPress Trac] #20103: Rewrite get_themes() and other enemies of sanity

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 22 21:08:49 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):

 [attachment:20103.diff] rewrites search_theme_directories(). It uses
 scandir() rather than opendir/readdir, eliminates unnecessary loops in
 favor of file_exists() checks, takes maximum indentation from 9 tabs down
 to about 5, and makes some attempt to improve variable names.

 The average time it took for search_thmee_directories() to run over wp-
 content/themes/ (where /themes/ was a checkout of http://wpcom-
 themes.svn.automattic.com) went from to 0.02042368 to 0.00315408 seconds,
 an 85% speed-up.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20103#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list