[wp-trac] [WordPress Trac] #28575: Eliminate redundant preg_match() to improve wptexturize() performance

WordPress Trac noreply at wordpress.org
Thu Jun 19 12:33:30 UTC 2014


#28575: Eliminate redundant preg_match() to improve wptexturize() performance
-------------------------------------+-----------------------------
 Reporter:  dllh                     |       Owner:  SergeyBiryukov
     Type:  defect (bug)             |      Status:  reopened
 Priority:  normal                   |   Milestone:  4.0
Component:  Formatting               |     Version:  3.9
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  performance
-------------------------------------+-----------------------------

Comment (by dllh):

 Replying to [comment:7 SergeyBiryukov]:
 > Indeed, looks like [attachment:28575.patch] would be a correct solution
 here.
 >
 > But even if it was a typo, how does [28776] corrupt HTML output? All
 texturize unit tests still pass, including the
 [source:trunk/tests/phpunit/tests/formatting/WPTexturize.php?rev=28773#L753
 multiplication test].

 I had just come up with the same patch after some more testing. I hadn't
 tested with markup that included a multiplication string. Interestingly,
 with the old code, the slowness reproduced for me only when the post did
 not include such a string. That is, when I test the code from before my
 patch with html that includes a 9x9 string, it's fast; when the html does
 not include such a string, it's slow.So in testing [27839], I suppose the
 tested code included the multiplication strings and the slowness was never
 manifest.

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


More information about the wp-trac mailing list