Optimizing PHP: Array Lookups Instead of Nested Loops

from blog Blog | Pekka Laiho, | ↗ original
One of the most common issues that I see almost daily when reviewing code is nested loops where they aren't required. They are particularly tricky because they are not slow with small data sets (which developers often use for testing), but become slow in production environment where data sets are larger. Of course, testing with too small data...