[wp-trac] [WordPress Trac] #45854: Avoid printf/sprintf strings to be "double-quoted"
WordPress Trac
noreply at wordpress.org
Tue Jan 8 21:07:22 UTC 2019
#45854: Avoid printf/sprintf strings to be "double-quoted"
-----------------------------+------------------------------
Reporter: arena | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch close | Focuses:
-----------------------------+------------------------------
Comment (by chriscct7):
Yes but it does that while producing the opcodes, not when it runs those
opcodes for execution. Most servers use an opcache layer, so you're not
compiling the opcodes for each runtime, and therefore there's no
difference. Even where ones where there's no opcaching enabled, in modern
day (PHP 5.2+, particularly in PHP 7.x branches which WP is moving toward
making it's minimum supported PHP version by EOL) PHP the speed of lexing
for a variable is so fast that there is no measurable difference even if
you run the test runs millions of times.
It's like removing a fly from an aircraft carrier to save weight & fuel
consumption. In theory can it make a difference, yes. In any production
environment will it ever make a difference, no.
A good resource that explains a lot of this can be found at
https://nikic.github.io/2012/01/09/Disproving-the-Single-Quotes-
Performance-Myth.html
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45854#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list