Thanks for your answer. I've already had a look at
, and it's a great module. It doesn't help much on the performance in my case, though, as I already cache database connections and queries.
Due to the complexity of my application I wasn't able to show that in the code I wrote in my original message. I see now that I should have "warned" you about that. :-)