Comments are closed.
I think the convincing difference here though is the posting of actual data to show WHY the author feels that these sorts of optimizations are myths or not. Saying "my benchmarks showed negligible results" is different than posting the actual number of Opcodes that are run with each method. It’s important to know what type of benchmarks were used. At a company I worked for they had an internal order form that had a drop down select with thousands of options in it (not very user friendly, I know). We spent some time fiddling with this order form to try and optimize some of the PHP code, as a test we switched the single quoted string with concatenated variables to a double quoted string and profiled it a number of times (with Zend Studio/Server). There appeared to be a clear performance benefit from using the single quote method in that huge select list. Even a negligible difference may have huge effects if run rnough times in succession. :)
I wasn’t saying that the article at whenpenguinsattack was inaccurate. I was referring to the person linking to: Sara Goleman’s post. I am sorry I wasn’t more clear with my post.
Even if she is an expert and wrote a book (which doesn’t make her an expert in my mind), I wouldn’t discount the article at whenpenguinsattack.com. There needs to be many sources by different "experts".
The article by Justin Silverton was very interesting and I’m glad you posted it. He seems to know what he is talking about in terms of PHP (One of his posts said he has been in the industry for 10 years or so).
I was just trying to point out that we need to keep our minds open with things like this (after all, many people get second opinions from a few different doctors, which are experts in their field).
Thanks for the comment. I should have done more research before posting the link to the original blog. As to Matthew’s source. Sara Goleman is on the PHP Internals list, has contributed several PHP extensions to PECL= and just published a book on writing PHP extensions with SAMMS Publishing. She is a recognized expert in the community.
I think we need a little more research than a random blog article. How do we know the blog you provided is any more accurate or correct than the one at whenpenguinsattack?
I don’t know about you, but I consider many sources before finally deciding upon something as right or wrong.
Thanks for clearing that up and thanks for the link pointing us in the right direction.
Sara Golemon specifically addressed (a)(echo faster than print) and (c) (double quotes vs. concatenation) recently:
The author of the blog entry should have done some more homework.