Friday, January 28, 2005

I've had my performance hat on at work for the last couple of weeks, optimizing memory and CPU performance ahead of the deployment of a new system.  I've been pretty pleased with the improvements we've made.  We've got alot of in-process caching that increases speed incredibly, but has a hefty footprint.  We were able to get that down quite a bit with some pretty clever ideas.

One of the major pushes was to reduce references, especially boxed references.  That has proven a very effective strategy to reduce memory.  I wish I could just throw generics at the boxing problem, but we'll have to wait a while longer for that.  Another strategy was to take a close look at the data structures that hold the cached data.  I rolled my own AVL tree implementation for a date-based index of the cached data, and I was able to improve both the CPU performance and it's footprint substantially.

We also implemented what I've called a local string intern pool.  We've got alot of redundant string data, and we've used String.Intern in the past fairly successfully, but some analysis of our data revealed some local redundancy that we could use to reduce a 4-byte reference to a single byte that acts as an index into the local string pool.  This will also help keep our memory from bloating on the move to 64-bits when all the references in the system double in size.  (although at that point, we should have loads more memory to work with)  This as the added benefit of eliminating the need for string comparisons in running searches against the cache.

All in all, we were able to reduce the footprint of the cache by about 40%.  I thought someone googling for ways to reduce memory footprint and increase performance might benefit some from this information.  Oh, and so Google puts this in the right context, this is related to: ASP.NET, CLR, C#, DotNet.

posted on Friday, January 28, 2005 8:57:45 AM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
Related posts:
LinqToStdf now on CodePlex
Image Slicer for Deep Zoom in Silverlight 2
Silverlight limitations and Constrained Callvirt in IL
What are the generic Delegates in the framework for?
What is System.__Canon and why is it on my stack?
Adding support for .ashx-based views in ASP.net MVC
Tracked by:
"Triumph the Insult Comic Dog Downloads" (Triumph the Insult Comic Dog Downloads... [Trackback]
"italian handbag" (italian handbag) [Trackback]
"Delorean Replicas" (Delorean Replicas) [Trackback]
"Pin Striping Tape" (Pin Striping Tape) [Trackback]
"dual channel ram" (dual channel ram) [Trackback]
"accomplishments of Martin Luther King Jr." (accomplishments of Martin Luther Ki... [Trackback]
"Se47 Full Housing" (Se47 Full Housing) [Trackback]
"Facts about Georgia" (Facts about Georgia) [Trackback]
"rural houses in majorca" (rural houses in majorca) [Trackback]
"18 and i still wet the bed" (18 and i still wet the bed) [Trackback]
"Problems with Pontiac Bonneville" (Problems with Pontiac Bonneville) [Trackback]
"iron based adsorbents" (iron based adsorbents) [Trackback]
"motivation scale" (motivation scale) [Trackback]
"Rio de Janiero" (Rio de Janiero) [Trackback]
"Singles Cruises" (Singles Cruises) [Trackback]
"samsonite tripods" (samsonite tripods) [Trackback]
"Ulysses S Grant" (Ulysses S Grant) [Trackback]
"cumaru engineered hardwood" (cumaru engineered hardwood) [Trackback]
"phendimetrazine 105mg free shipping" (phendimetrazine 105mg free shipping) [Trackback]
"j2ee servlet" (j2ee servlet) [Trackback]
"linux format" (linux format) [Trackback]
"antifurto auto" (antifurto auto) [Trackback]
"bead jewelry" (bead jewelry) [Trackback]
"acrylic nail removal" (acrylic nail removal) [Trackback]
"Florida boating accident attorney" (Florida boating accident attorney) [Trackback]
"Men%27s Pocket Watches" (Men%27s Pocket Watches) [Trackback]
"WICKED WITCHES OF LEGEND AND LORE" (WICKED WITCHES OF LEGEND AND LORE) [Trackback]
"bipolar disease" (bipolar disease) [Trackback]
Saturday, January 29, 2005 1:24:38 PM (Pacific Standard Time, UTC-08:00)
Although this was way over my head I found it interesting, although I found a typo. You said, "This as the added benefit of eliminating the need for string comparisons in running searches against the cache." and you meant to say "This HAS the added..."
From your dad - the English major who has to put his education to use some time.
See my new PDA Madness blog
Saturday, January 29, 2005 1:25:11 PM (Pacific Standard Time, UTC-08:00)
Oh, by the way, what is a performance hat?
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):