[wp-trac] [WordPress Trac] #30986: Consider using an abstract syntax tree for wpautop

WordPress Trac noreply at wordpress.org
Wed Jan 14 15:56:22 UTC 2015


#30986: Consider using an abstract syntax tree for wpautop
-------------------------+------------------------------
 Reporter:  ericlewis    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Formatting   |     Version:  0.71
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by ericlewis):

 Replying to [comment:3 ericlewis]:
 > Replying to [comment:2 dd32]:
 > > 1. Speed; `wpautop()` is called on the front end, needs to be a decent
 speed
 >
 > Here's benchmark results from my basic test:
 >
 > {{{
 > Seconds for 10000 wpautop() invocations: 0.020344972610474
 > Seconds for 10000 WP_AutoP class invocations: 0.34989809989929
 > }}}
 >
 > So it looks like the class is 17x slower than `wpautop()` in its current
 form.

 Scratch that, I bungled the test case here. In attachment:30986.4.diff I
 fixed the benchmarks, which produces these results:

 {{{
 Seconds for 1000 wpautop() invocations: 3.852117061615
 Seconds for 1000 WP_AutoP class invocations: 8.0365650653839
 }}}

 So the class is ~1x slower than `wpautop()` in its current form.

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


More information about the wp-trac mailing list