[wp-trac] [WordPress Trac] #24106: Simplify wp_slash()
WordPress Trac
noreply at wordpress.org
Sun Nov 17 22:48:15 UTC 2013
#24106: Simplify wp_slash()
------------------------------+------------------
Reporter: TobiasBg | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.8
Component: Formatting | Version: 3.6
Severity: normal | Resolution:
Keywords: has-patch commit |
------------------------------+------------------
Comment (by SergeyBiryukov):
Wrote a quick script to test the performance of the suggested change with
1,000,000 iterations: [attachment:24106.test.php].
The unpatched version appears to be about 25% faster:
||Simple array||Nested arrays||
||7.121s — unpatched||19.524s — unpatched||
||9.754s — [attachment:24106.2.patch]||26.051s —
[attachment:24106.2.patch]||
Not sure if performance is crucial for this function though.
`stripslashes_deep()` [source:tags/3.7.1/src/wp-
includes/formatting.php#L1429 uses array_map() too], so I guess it would
make sense for `wp_slash()` to be consistent.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24106#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list