Lampooning Benchmarks
Original post provide by Ben RamseyWhen I first came across Jonathan Street’s “7 tips for lightning fast PHP sites” blog post via PHPDeveloper.org, my first reaction was something like: “Egads! These benchmarks are stupid and misleading! These functions are simply aliases of each other. There should be no discernible difference, and any buffoon should realize this fallacy!” This was before I clicked through from PHPDeveloper.org to read his post.
Then, I clicked through to the post, and I was still dumbfounded that Jonathan found marginal microsecond differences between how the functions performed and was advocating the use of one function over the other based on this “data.” I questioned the testing, and I was prepared to dig through the PHP source to write up a post refuting his claims.
And then I did something smart…
I followed a link to his follow-up post entitled “Better Benchmarks” in which he explains that his previous post was a lampoon that “was supposed to be a spoof celebrating the worst aspects of these types of posts.” He went on to explain:
I had thought that with comparing aliases of functions seven times over people would realise what I was doing but apparently my post was just too close to the sad reality and lacking in sufficient humour for people to catch on.
When reading it in this light, it actually is really humorous. He goes on to explain another round of testing he did that was intended to show a more accurate measurement of the results. His findings are not unexpected, and he admits that:
Overall I conclude that there is no statistical difference between the aliases of a function in the tests that have been run. Although this was the expected result I hope that the analysis presented is sufficiently rigorous to discount the possibility of personal bias in the benchmark.
However, for the naysayers out there, I’ll post some lines from ext/standard/basic_functions.c in the PHP source. This should prove that the only difference in these functions is the name itself. All other code is shared. (Note that is_int() and is_integer() are actually both aliases of is_long(), even though the manual prefers is_int()).
PHP_FALIAS(chop, rtrim, arginfo_rtrim) PHP_FALIAS(ini_alter, ini_set, arginfo_ini_set) PHP_FALIAS(doubleval, floatval, arginfo_floatval) PHP_FALIAS(is_int, is_long, arginfo_is_long) PHP_FALIAS(is_integer, is_long, arginfo_is_long) PHP_FALIAS(join, implode, arginfo_implode) PHP_FALIAS(fputs, fwrite, arginfo_fwrite) PHP_FALIAS(sizeof, count, arginfo_count)
So, what can we learn from this? For starters, always read follow-up posts, and never take part in function benchmarking wars.
aliases, benchmarks, php, testing
Previous Articles:SPL Article Published
My article was originally intended to be part of a series of articles about features and functionality in PHP 5 that provided a case for adopting/upgrading to PHP 5. Cal Evans, editor-in-chief of Zend Developer Zone, ultimately decided against publishing these articles in a “series” format, but I think the individual articles that were published still fit together fairly well for making a case to upgrade to PHP 5.
Excel 2007 Multiplication Bug
tibbar66 writes with news of a serious multiplication bug in Excel 2007, which has been reported to the company. The example first that came to light is =85077.1 — which gives a result of 100,000 instead of the correct 65,535.
Gopal Vijayaraghavan's Blog: APC Autofilter: The Real Story
He presents a dilemma where classes are created in two different ways (inside and outside included files) and a problem that could cause the APC caching to not cache a file at all after a certain point. He even gives an example of how, in normal code and a pretty basic development situation, this sort of thing could happen.
Nexaweb Delivers Enterprise Web 2.0 Suite At AJAXWorld
Nexaweb Technologies, provider of the leading standards-based platform for building and deploying Enterprise Web 2.0 (EW2.0) applications, today announced the latest release of its Nexaweb Enterprise Web 2.0 Suite. Nexaweb?s Enterprise Web 2.0 Suite enhanced design and management features, as well as its interoperability with leading governance solutions from Layer 7 and HP Systinet, make it the ideal RIA, composite application and enterprise mash-up development and deployment platform for IT organizations and the heterogeneous and distributed business groups they serve.
Felix Geisendorfer's Blog: Migrating From WordPress To CakePHP
In this post I'm simply going to throw out some snippets to show how I'm currently approaching the whole process in order to give both my insight into what works and what doesn't, while also hoping to get some people to share their insight into migrating legacy apps to CakePHP.
More Articles:
Networking On Ryze: A Strategic Plan For Making Higher Quality Contacts
So target your networking, and carve a path to success and prosperity for your home-based Web business. Your Friends List is Your Circle of Trust Your Friends List can include anybody you wish, but ideally it should consist of people you know and trust.
Online Maps Warning
I was horrified. I used Google Maps and it was perfect in giving directions and showing the location of the event. This is a lesson in how technology can screw up the best laid plans. About five people got lost and thankfully, my out of town family found their way even though I gave them the right map and posted it on the event’s Web site.
Ruby On Rails Proves It Deserves The Hype
JDO? Do I need to use EJB2 or EJB3? Rails has an ORM database layer built into its framework called ActiveRecord. Another useful feature of Rails is scaffolding - Similar to how a building under construction uses scaffolding to assist in the construction of the final structure, Rails can generate code called scaffolding that can be used to quickly put up functional Web pages that talk to a database and allow you to add, delete and change information quickly and with very little coding.
Zend/PHP Conference 2007
That’s your place to chat with other attendees during the conference and find out where everyone’s going for food and drinks in the after-hours. In addition, there is a zendcon twitter user. Start following it today to get zendcon tweets during the conference.
Learning ASP.NET 2.0 With AJAX
So whether you hope to create easy-to-use order forms and interactive databases, build pages that display information interactively without a page refresh, or create dynamic navigation tools, this reference shows you how. “The best part is you’ll do it all with minimal coding,” add the authors.