[wp-trac] [WordPress Trac] #28724: Optimize Regexp Usage in wptexturize()
WordPress Trac
noreply at wordpress.org
Sat Jul 5 15:32:08 UTC 2014
#28724: Optimize Regexp Usage in wptexturize()
-------------------------+------------------
Reporter: miqrogroove | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.0
Component: Formatting | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+------------------
Comment (by miqrogroove):
In miqro-28724-part2.patch:
* Optimize handling of whitespace in wptexturize().
What I found was that HTML-heavy posts tend to have a large amount of
whitespace between elements, due to the formatting imposed by TinyMCE.
Lists and tables in particular tend to have a newline after every element.
These cases improve by ~25% less time spent texturizing whitespace.
A moderately long post with little HTML still tends to contain whitespace
around commonly used shortcodes, the "more" tag, and the inline formatting
tags. There is a minimal speed improvement in these cases.
Short posts such as "hello world" will have a fixed cost and tend not to
benefit from optimizations.
Let's commit that and call it fixed. :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28724#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list