Are you concerned about speed because you are already dealing with a situation where speed is a problem or are you planning ahead?
I can say with confidence that database interactions are usually limited by IO, network bandwidth, memory, database traffic, SQL complexity, database configuration, indexing problems and the amount of data selected is much more than choosing a scripting language against C.
When you encounter bottlenecks, they will almost always be solved with a better algorithm, smarter use of indexes, faster I / O devices, more caching ... those kinds of things (starting with algorithms).
The fourth component of LAMP is a scripting language. With fine-tuning, memcache becomes an option, as well as persistent interpreters (for example, mod_perl in a web environment, for example).
source share