Quote:
Originally Posted by Varius
As for database / query optimization, I think that is EXTREMELY important.
|
One little thing that I've seen many times because the programmers don't understand the data.
You quite often see coding that looks something like this with test arranged in order:
Code:
switch ($someField) {
case "A":
do_A();
break;
case "B":
do_B();
break;
case "C":
do_C();
break;
default:
doOtherThing();
}
But if condition "C" equals 90% of the time, you should do the test for
"C" first.
Very simple concept, that has major performance issues when dealing with high volumes. I've even written code that modifies this testing code based on current data being used.