[wp-trac] [WordPress Trac] #50683: Parse content for shortcodes instead of using regex

WordPress Trac noreply at wordpress.org
Sat Aug 7 14:35:26 UTC 2021


#50683: Parse content for shortcodes instead of using regex
-------------------------------------------------+-------------------------
 Reporter:  cfinke                               |       Owner:
                                                 |  johnbillion
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  5.9
Component:  Shortcodes                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests early       |     Focuses:
  needs-testing early-like-actually-early        |
  needs-testing-info                             |
-------------------------------------------------+-------------------------

Comment (by johnbillion):

 I've moved this into a PR at https://github.com/WordPress/wordpress-
 develop/pull/1554 so we can assess the performance impact across PHP
 versions on the GitHub Actions CI.

 I've increased the size of the content added to the performance test
 payloads so they stress test the parser more and reduce the variance when
 re-running the tests. The "long content" data is now 100,000 bytes
 (instead of 1,000) which is roughly equal to 15,000 words in English.

 I'll let the tests run without the parser in place to get a baseline, then
 add the parser and run the tests again.

 On my local installation I'm seeing a slight performance degradation from
 a total of around `0.03s` to around `0.15s`, which is slower but not
 something I would worry about too much. The advantage of fixing bugs
 outweighs a minimal performance impact at the extremities of content size.

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


More information about the wp-trac mailing list