[wp-trac] [WordPress Trac] #35293: Emoji Regex in wp_encode_emoji() is wildly inaccurate

WordPress Trac noreply at wordpress.org
Wed Aug 2 13:23:55 UTC 2017


#35293: Emoji Regex in wp_encode_emoji() is wildly inaccurate
--------------------------+-----------------------
 Reporter:  pento         |       Owner:  pento
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.9
Component:  Emoji         |     Version:  4.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------

Comment (by pento):

 == Test 4.2

 While testing, I realised that the staticize code splits by HTML tags, but
 the test data had no HTML. I've added that in, which caused 4.1 to become
 a bit slower.

 Fortunately, I was also able to optimise the loss, and a bit more, away by
 making staticize check if there's an instance of the current emoji to
 replace, before building the HTML string to replace it with.

 '''Data''': https://travis-ci.org/pento/test-41501/builds/260190895

 '''Analysis''':
 - This test was generally faster than 4 and 4.1, despite the slower test
 data.
 - Applying a similar optimisation to `wp_encode_emoji2()` seems to have no
 benefit.

 '''Conclusion''': Still on the right track.

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


More information about the wp-trac mailing list