scalability
Fast code: Speed and Scalability in PHP applications
Submitted by John Locke on Sun, 01/13/2008 - 04:33Continuing on the series, the next item on the list seems to be the mistake I see the most--putting slow code in loops, loading up things that don't need to be loaded, making simple requests expensive.
In terms of processing time, it's expensive to open a database connection. It's expensive to connect to another computer. It's expensive to load up a big framework to respond to a single request. It's relatively cheap to retrieve a pre-constructed page out of a cache.
The single biggest mistake I see that kills performance in code is putting database calls inside a loop.
















