[wp-trac] [WordPress Trac] #20838: Don't populate $col_info in production

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 4 19:42:19 UTC 2012


#20838: Don't populate $col_info in production
-------------------------+-----------------------------
 Reporter:  GrahamKelly  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Database     |    Version:  3.3.2
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 While profiling WordPress 3.3.2 I noticed that mysql_fetch_field() seemed
 to be fairly expensive. Upon looking into this I found that the col_info
 property is being set in wpdb but it does not appear (from some grepping
 through WP Core and quite a few extensions) that anyone is actually making
 use of the results (Either from directly accessing $col_info or from calls
 to get_col_info). In order to improve performance I wrapped the calls in
 'if (WP_DEBUG)' which seems to do the trick.

 Patch attached.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20838>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list