Hi Andy, This is really interesting. I know very little about the internals of php, but several sites that I read claimed it was less cpu cycles. This is good info. Also, if this is wasting anyones time, please feel free to disregard. You do not need to read nor respond to this. Having a desire to help the project improve performance should hardly be scoffed at or shot down. This is how to discourage people from wanting to help. If my testing is incorrect, please feel free to correct and give information on how to better test. I have spent quite a bit of time on things that many people have felt are "worthless" (Memcache, APC Cache, core cache serialization patch) and have had a good performance impact. It is my area of interest. I apologize if it offends anyone for posting to this list about it. Is there a better place to post about this stuff? Steve Rude andy@spiders-lair.com wrote:
1326ms vs. 1382ms is 60ms, and when normal page load times are somewhere around 200ms, it makes a substantial difference.
Even if we disregard the fact that microtime tests have a big stddev,
We shouldn't do that. The posted results are totally worthless without an error estimate.
People, stop wasting everybody's time, read
http://drupal.org/node/79237, or preferably an introduction to
statistics and a howto on doing experiments in first year phyiscs, then re-do the tests.
imo the tests are pretty pointless. Given that PHP uses the zend hashtable to store all lists of this type (including constants) then this link shows how the table hash key is generated using the DJBX33A algorithm:-
http://lxr.php.net/source/ZendEngine2/zend_hash.h#315
Seems to me that upper or lower case won't have an effect on this (not one that microtime is going to perceive anyhow) so this hardly seems worth following up.
If you really feel the "need for speed" then the only suggestion is to keep all constant definitions to 8 characters or less. Hardly practical in the real world.
--Andy
-- Steve Rude + Lead Developer *AchieveInternet* (800) 618-8777 x 202 http://www.achieveinternet.com