[development] Increase performance of caching

Khalid Baheyeldin kb at 2bits.com
Tue May 1 17:23:36 UTC 2007


On 5/1/07, Jeff Fillmore <jfillmore at sublimenet.com> wrote:
>
> Dear Developers,
>
> I got some requests for the Benchmarks on the changes that I made to the
> caching so here are the benchmarks:
>
> Before:
> Queries: 113    DB time: 120ms  Page Execution Time: 495ms
> Memory: 11.4 / 12.17
>
> After:
> Queries: 102    DB time: 105ms  Page Execution Time: 484ms
> Memory: 11.41 / 12.29


I would be interested in the same benchmark but with MySQL
restarted before each run, to eliminate any query cache effects.

It seems there is some overhead in PHP now that offset the 15 ms
gain in database access, and made that 11 ms gain out of 495 (only
2% gain).

Memory usage is a tad higher, but not significantly.

Try using ab or ab2 with 500 requests and 5 concurrency, to see if
that adds up for multiple requests or what.

Let me know what you think and it would be nice to get some feed back from
> some other test sites.  This data help me to know if I should continue on
> this path.
>
> Thanks
>
> Jeff Fillmore
> jfillmore at sublimenet.com
> Sublimenet INC
> 208-323-9451
>
> -----Original Message-----
> From: development-bounces at drupal.org [mailto:
> development-bounces at drupal.org] On Behalf Of Larry Garfield
> Sent: Monday, April 30, 2007 12:28 PM
> To: development at drupal.org
> Subject: Re: [development] Increase performance of caching
>
>
> Drupal uses a lot of static caching, so in concept I don't see a problem
> with this.  Benchmarks would be useful, though, both on speed and memory
> usage.
>
> That said, this should be submitted as a feature request patch against
> Drupal 6 so that it can be reviewed in the issue queue rather than on the
> dev list.  See:
>
> http://drupal.org/node/320
> http://drupal.org/patch/create
>
> Thanks!
>
> --Larry Garfield
>
> On Mon, 30 Apr 2007 11:22:04 -0600, "Jeff Fillmore" <
> jfillmore at sublimenet.com> wrote:
> > Dear Developers,
> >
> >
> >
> >             I've been working with a few modifications to the caching
> > system of Drupal, and have found a simple way to speed it up by about 5%
> > across the board ( more with pages that use the cache system more) with
> > only adding five lines of code.
> >
> >
> >
> >             I found that Drupal was calling the cache table multiple
> times
> > to get the same data so I put the data in a static array.
> >
> > At the top of cache_get function in includes/cache.inc I added these
> four
> > lines on line 15:
> >
> >
> >
> > static $cache_array = array();
> >
> > if ($cache_array[$key] != null){
> >
> >                         return $cache_array[$key];
> >
> >             }
> >
> >
> >
> >             Right before $cache is returned I added this line on line
> 45:
> >
> >
> >
> > $cache_array[$key]=$cache;
> >
> >
> >
> > I am sure there are lots of other ways to do this, but the reason that I
> > modified the core code directly is that I felt that this type of
> increase
> > should not a matter of adding a new module, if it is even possible with
> > another module. Although this will increase the overall size of the
> apache
> > children during runtime I felt that it was a small price for the speed
> of
> > the application and overall user throughput. Also are there any other
> > places that we could do something similar. For instance cache the menus
> in
> > memory for the 'drupal_lookup_path' for instance.
> >
> >
> >
> > Because this is in the caching for registered and anonymous users the
> > benefit is across the board. Although the increase will diminish over
> the
> > size of the site, it should be a rather substantial increase for about
> > 70-80% of the drupal installs out there.
> >
> >
> >
> > I am curious to hear feedback as to what you guys think of this
> addition,
> > and the overall speed increase and offsets. And potentially other
> > increases that would be of similar avenues and if we should pursue them.
> >
> >
> >
> >
> >
> > Thanks
> >
> >
> >
> > Jeff Fillmore
> >
> > HYPERLINK "mailto:jfillmore at sublimenet.com"jfillmore at sublimenet.com
> >
> > Sublimenet INC
> >
> > 208-323-9451
> >
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.467 / Virus Database: 269.6.2/781 - Release Date: 4/30/2007
> > 9:14 AM
> >
> >
> >
>
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.6.2/781 - Release Date: 4/30/2007
> 9:14 AM
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.6.2/782 - Release Date: 5/1/2007
> 2:10 AM
>
>


-- 
2bits.com
http://2bits.com
Drupal development, customization and consulting.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070501/1ab8c37b/attachment-0001.htm 


More information about the development mailing list