"When simple strings with no variables in them are used, the performance is clearly better with double-quoted strings due to implementation details in the engine." Is there any way this could be true except that they went out of their way to slow down single-quoted strings? How could it possibly be slower to do fewer steps?
PHP Team Responds to Google's PHP Tips
11–20 of 40 posts
Re: PHP Team Responds to Google's PHP Tips
#12Considering Google's influence and reputation, it's really important the PHP Team took the time and effort to respond to the "tips" and set the record straight.
Re: PHP Team Responds to Google's PHP Tips
#13Re: PHP Team Responds to Google's PHP Tips
#14Re: PHP Team Responds to Google's PHP Tips
#15And even after installing the opcode cache, performance for many web apps doesn't improve much as the bottleneck is often in the DB. Caching DB results where possible (pretty simple to implement with your own code or an external library) often results in far greater performance gain than any type of code optimization. If you can actually cache the resulting HTML (all or parts), even better.
Re: PHP Team Responds to Google's PHP Tips
#16Despite google dropping ball on this one, some good may come from it having spurred Gwynne Raskind's reply: Anyone out there writing PHP might find real optimization value from Alex Songe comments, concluding with (following Gwynne's article): Good resources (written by the guys who actually work on the php engine): http://ilia.ws/files/phptek2007_performance.pdf (13 MB) http://ilia.ws/files/phpquebec_2009.pdf ( 1.1…
Re: PHP Team Responds to Google's PHP Tips
#17Earlier quoted context omitted.
If I was going to guess, I'd say that double quoted strings are passed to a different "engine" than the single quotes, and perhaps over time the double quote engine has received better optimization.
Yeah, thats what I also figured but, really, how much can you optimize a constant string literal (which I'm given to understand the single-quote thing is)? Must be some kind of caching optimization and not really something that saves CPU cycles
Re: PHP Team Responds to Google's PHP Tips
#18I (naively) read Google's performance tips as fact and wouldn't have thought twice about it. Lesson learned.
Saving a byte here and there for the sake of transfer-speed, without a thought for rendering speed or maintainability, is apparently ideal.
Re: PHP Team Responds to Google's PHP Tips
#19Even if all the tips were valid, the performance gain is tiny in comparison to simply installing an opcode cache (APC/Zend/etc). And even after installing the opcode cache, performance for many web apps doesn't improve much as the bottleneck is often in the DB. Caching DB results where possible (pretty simple to implement with your own code or an external library) often results in far greater performance gain than an…
Re: PHP Team Responds to Google's PHP Tips
#20"When simple strings with no variables in them are used, the performance is clearly better with double-quoted strings due to implementation details in the engine." Is there any way this could be true except that they went out of their way to slow down single-quoted strings? How could it possibly be slower to do fewer steps?