WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #35022, comment 15


Ignore:
Timestamp:
03/17/2016 06:39:05 PM (4 years ago)
Author:
steevithak
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35022, comment 15

    initial v1  
    1 Ok, I think I answered my own question. Ticket #33517 identified performance problems with WP posts containing massive numbers of shortcodes. If I'm understanding what happened correctly, a patch was applied that greatly improved performance by allowing the various parsing functions to make quickie passes through the post content, pulling out a list of shortcode tags using simplified regexes (that, for example, don't bother to properly identify every possible type of space character, just the most common ones). The patch for that bug appears to coincide with both the creation of this bug and the proliferation of alternate regexes I'm seeing. Give that we're worried about regex performance issues here, maybe the best we can hope for is to extend the hack that's already in shortcode_parse_atts() and just do a global replace of all other space chars with an 0x20 prior to running the regex. That seems less likely to bring back performance issues for people who have many hundreds of shortcodes than what I proposed in the original bug report.
     1Ok, I think I answered my own question. Ticket #33517 identified performance problems with WP posts containing massive numbers of shortcodes. If I'm understanding what happened correctly, a patch was applied that greatly improved performance by allowing the various parsing functions to make quickie passes through the post content, pulling out a list of shortcode tags using simplified regexes (that, for example, don't bother to properly identify every possible type of space character, just the most common ones). The patch for that bug appears to coincide with both the creation of this bug and the proliferation of alternate regexes I'm seeing. Given that we're worried about regex performance issues here, maybe the best we can hope for is to extend the hack that's already in shortcode_parse_atts() and just do a global replace of all other space chars with an 0x20 prior to running the regex. That seems less likely to bring back performance issues for people who have many hundreds of shortcodes than what I proposed in the original bug report.