[wp-trac] [WordPress Trac] #30430: WP_Object_Cache does not properly cache objects nested in arrays

WordPress Trac noreply at wordpress.org
Sat Mar 7 12:56:00 UTC 2015


#30430: WP_Object_Cache does not properly cache objects nested in arrays
-------------------------------------------------+-------------------------
 Reporter:  jamesgol                             |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Cache API                            |  Review
 Severity:  normal                               |     Version:  2.0
 Keywords:  reporter-feedback has-patch needs-   |  Resolution:
  testing needs-unit-tests                       |     Focuses:
-------------------------------------------------+-------------------------

Comment (by jipmoors):

 Replying to [comment:10 jamesgol]:
 > Replying to [comment:9 jipmoors]:
 > > Could you explain how that would be more efficient? The opcode of the
 function would be reduced by removing the duplicate functionality.
 > >
 > > The suggested benefit would be neglegable and the readability is
 greatly improved by not repeating the code, in my opinion.
 >
 > It is more efficient because it reduces the amount of code called. In
 the best case it is negligible (less than .1% more efficient) but in the
 more complicated cases when this is actually needed for it is 1-2.9% more
 efficient (depending on the type of data).

 Adding duplicate functionality only increases the amount of code needing
 to be parsed to opcode and the only way to know which method is faster is
 to run some actual tests. But recalling a function -should- be more
 efficient than repeating the functionality of that function inside itself.

 I agree that this is offtopic, but I think it's good to have these kind of
 discussions to improve the quality of code and coder :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30430#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list