[wp-trac] [WordPress Trac] #24023: 3.5/wp-includes/functions.php : missing break statement

WordPress Trac noreply at wordpress.org
Wed Apr 10 12:47:14 UTC 2013


#24023: 3.5/wp-includes/functions.php : missing break statement
--------------------------+------------------------------
 Reporter:  tivnet        |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.5.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------
Changes (by SergeyBiryukov):

 * severity:  trivial => normal
 * milestone:   => Awaiting Review


Comment:

 Replying to [comment:4 nacin]:
 > This method is written for speed. It's faster to reach into the string
 than attempt to unserialize.

 Performed a quick test with 1,000,000 iterations of `is_serialized()` and
 `_is_serialized()` from comment:5: [attachment:24023.test.php].

 Turned out that `_is_serialized()` is actually 20% faster:
 {{{
 is_serialized(): 52,366 seconds
 _is_serialized(): 40,198 seconds
 }}}
 Removing the `is_string()` check (marked as "this is not required") makes
 both results almost equal though:
 {{{
 is_serialized(): 52,154 seconds
 _is_serialized(): 51,392 seconds
 }}}

 Switching to `unserialize()` would fix #18007 as well.

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


More information about the wp-trac mailing list