|
Posted by Jeff on 07/26/07 00:48
On Jul 25, 6:26 pm, Vladimir Ghetau <vladi...@pixeltomorrow.com>
wrote:
> Hi guys,
>
> I'm trying to get the best out of an application, powered by MySQL by
> simply grabbing everything into a big array, the use it along the code
> so I can avoid having too many requests to the database, which
> obviously slows down the script.
>
> I've played with xcache before, but because it wasn't my code I
> couldn't really understand the process completely.
>
> What is the best practice when you want to use array caching, and how
> to take advantage of it? There are many documents on how to speed your
> PHP applications, but I believe since php 5 became popular I can do
> better than simple tweaks.
>
> Thanks,
>
> Vladimir
Using numerically indexed arrays will speed it up, but you risk hard-
coding. I haven't messed with array caching. When performing
operations on them, you can do a foreach ($arr as &$val) { ... } to
access the values referentially, thereby avoiding some of the memory
and lookup overhead.
Navigation:
[Reply to this message]
|