473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Memory Performance Optimization ???

What can anyone:
(1) Tell Me about
(2) Provide Links to
(3) Recommend Books
Pertaining to Memory Performance Optimization?

The main thing that I am looking for is rules-of-thumb
that maximize the execution speed of time critical
applications.

Thanks
Nov 17 '05 #1
3 2406
On Fri, 26 Aug 2005 18:03:55 -0500, "Peter Olcott" <ol****@att.net>
wrote:
What can anyone:
(1) Tell Me about
(2) Provide Links to
(3) Recommend Books
Pertaining to Memory Performance Optimization?

The main thing that I am looking for is rules-of-thumb
that maximize the execution speed of time critical
applications.

Thanks


Your talking about 2 different things: memory optimization and
performance optimization

Memory:

1) Leave memory management to garbage collector
2) If you really need to explicitly free up memory, use the following
notation:

using( MyClass myObj = new MyClass )
{
...
}
Note: MyClass should implement IDisposable interface.

3) Cache information wisely, do not abuse caching
Performance:

Things that affect performance negatively:

- creating objects and invoking methods by name via Reflection
(late-bound invocation)
- creating objects via Activator
- using interfaces in place of straight type references
- using delegates
- querying types for attributes
Nov 17 '05 #2
Peter Olcott wrote:
The main thing that I am looking for is rules-of-thumb
that maximize the execution speed of time critical
applications.


Memory-performance and runtime-performance are different things, usually
in direct opposition to each-other, since you can often trade memory and
runtime by using dynamic-programming (caching).

Use a profiler. Do *not* fall into the pit of micro-optimizing.

For performance-profiling, use a performance-profiler, like nprof or one
of the many available commercially. For memory profiling you can use the
rather neat CLRProfiler. Both can be found using google, now you know
the names.

If all else fail, you will need to look at the optimized JIT code
resulting from running the program to identify *what* is taking all
those CPU-seconds, don't expect to shave any real amount of CPU-time if
you are at this level. You can rewrite to minimize cast-checks,
index-checks and virtual-calls, but there's not too much to be gained here.

And, here is the BONUS rant :)

The most valuable resource in programming today is *developer-time*. So
you should probably look into how you can obtain low development-time
with acceptable runtime performance and memory consumption.

I have found that some of the best ways to reduce developer-time are:

- Solve the job at hand, not a generalized instance. You can *always*
generalize later. If your "process" prevents this, change your process.

- Identify the domain that your application/library should express,
and make the structure of your programming precisely reflect that. If a
design/architecture prevents this, change it, or secondly write an
adapter that fits into the design/architecture separatly.

- Code lazy. Always take the easiest solution to a problem, untill it
is verified (almost always by a profiler) that this code is the
performance-culprit.

- Constantly talk to whomever is your "customer", the one who you
deliver to, they may unspoken have input, you may have to make them
change their mind about what they want, and (very often) you
misunderstood eachother.

--
Helge Jensen
mailto:he**********@slog.dk
sip:he**********@slog.dk
-=> Sebastian cover-music: http://ungdomshus.nu <=-
Nov 17 '05 #3
"Peter Olcott" <ol****@att.net> wrote in message
news:cdNPe.2260$UI.1985@okepread05...
What can anyone:
(1) Tell Me about
(2) Provide Links to
(3) Recommend Books
Pertaining to Memory Performance Optimization?

The main thing that I am looking for is rules-of-thumb
that maximize the execution speed of time critical
applications.


Give this a read:

http://msdn.microsoft.com/library/de...l/scalenet.asp

It's one of the most thorough performace guides around. And measure,
measure, measure.

There's a good profiler here:

http://www.compuware.com/products/de...rtner&sf=1&p=0

Marc
http://nomagichere.blogspot.com
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
17
by: christophe.chazeau | last post by:
Hi, I have a problem with a really simple chunk of code which should work but does obviously does not. This chunk of code is just a POC aimed at finding a bug in a larger project in which the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.