Re: [Phplib-users] Caching MySQL queries
Brought to you by:
nhruby,
richardarcher
From: Donncha O C. <don...@tr...> - 2001-10-30 10:50:59
|
I'll send the patches on. I did a lot more work at the weekend on it. But here are some results: Without the cache reading 5,000 records takes 0.5 seconds every time. With the cache reading the same number of records takes 4.5 seconds to build the cache on the first run, and then 1.5 seconds each run after that for the life of the cache. Doing an eval() is expensive and with the larger dataset just chews time. I started work on another project (a weblog, coming along nicely!) and used the caching layer but it didn't seem very reliable. Results were returned or not sometimes. It could pay off if it was used in the context of a fetchall() function and/or if a long running query was cached. Some options: I rewrite the caching module so it creates files I can include(). This might be faster than doing an eval() on the data. Cache each row in a seperate file. I can't imagine this would be faster but it would decrease memory usage. I might mail the author of the caching class I used to see if he has any ideas or recommendations. Donncha. "nathan r. hruby" wrote: > > On Fri, 26 Oct 2001, Donncha O Caoimh wrote: > > > I prefer to use the filesystem also. I've almost got it going now but at > > the moment it hangs for a while before reading from the cache. I suspect > > the cache class I'm using is waiting for the cache file to close or > > something. *shrug* I'll keep at it for another half an hour, going home > > then, it's late here! > > > > If anyone wants my work in progress code mail me off list soon and I'll > > mail you. Or I could post it to the list if nobody objects to an > > attachment? > > > > Send it to the SF patch manager. We won't stick it in but everyone will > have access to it without those nasty quota issues on everyone's inbox :) > > -n |