In the ColdFusion world we use the CF Mod() function alot.. but did you know how much overhead it actually creates? For each iteration it must divide the numbers in question and look at the remainder. Based on that remainder the Mod is either odd or even...
I stumbled on to a better way, ColdFusion has a function called BitAnd(), instead of dividing numbers
this works at the bit level and it's substantially faster:
Ben Nadel does a great overview here: http://www.bennadel.com/blog/668-Using-BitAnd-To-Determine-Odd-Even-Rows-Thanks-Tony-Petruzzi-.htm.
I've found a significant performance increase, especially with large data outputs needing alternating something..
No comments found.Commenting has been disabled for this entry.