My two cents are added to the closed ticket http://drupal.org/node/134697 Basically: * modulo is slower than bitwise-and and I think that this was the main culprit to the even/odd flip performance * microtimer is not a benchmarking tool Doug Green 904-583-3342 www.douggreenconsulting.com Bringing Ideas to Life with Software Artistry and Invention... Providing open source software political solutions -----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Karoly Negyesi Sent: Monday, April 09, 2007 8:19 PM To: development@drupal.org Subject: [development] Note that PHP arrays are fast Hi, Note my trick in http://drupal.org/node/134697 which shows that the hash lookups in Zend Engine are a bit faster than branching. Instead of $class = $class == 'even' ? 'odd' : 'even' we have $flip = array('even' => 'odd', 'odd' => 'even'); $class = $flip[$class]; The first can be as much as 10% slower. I will explore this area further and I recommend everyone to familiarize themselves with the vast array of php array functions :) because next Drupal will be even more abound with arrays. Regards, NK