[wp-trac] [WordPress Trac] #17128: POMO library performance considerations

WordPress Trac noreply at wordpress.org
Tue Mar 24 11:50:23 UTC 2015

#17128: POMO library performance considerations
 Reporter:  wet          |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  I18N         |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:

Comment (by ccismaru):

 There are a ton of calls to chr and is_null. Checking the code, there can
 be easily replaced with string equivalent or with language constructs,
 which will reduce the overhead of a function call as well as other code
 ran in the internal function bodies.

 chr(0) could be replaced with "\0x0", chr(4) with "\0x04". is_null(exp)
 with exp === NULL. Have tested this and about 22K calls were saved because
 of these minor changes. I'm aware that the code is more readable keeping
 them in place, as they are now, but in a shared hosting environment could
 make a big difference in saving CPU cycles.

Ticket URL: <https://core.trac.wordpress.org/ticket/17128#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list