.Net performance enhansement

  • Thread starter Thread starter Kovan Akrei
  • Start date Start date
K

Kovan Akrei

Hi,
What is the default heap size in CLR?
Does CLR take any options (as in JVM) to optimize the performance of a
mulithreaded application? For exmple increasing heap size.
How do I increase performance of the following application (test program)

public class DummyThread{
private Thread thread;
public DummyThread(){
thread = new Thread(new ThreadStart(Run));
}
private void Run(){}
}

class ThreadOverhead
{
static void Main(string[] args)
{
int maxThreads = 1000000;
for (int threads = 0; threads < maxThreads; threads++)
new DummyThread();
}
}

I hope my question are not that stupid :). I have searched news and msdn
pages, but I could not find answers to my questions.

Best regards from
Kovan Akrei
 
Kovan Akrei said:
What is the default heap size in CLR?

I can't remember what it starts off as, but it will increase as needed.
Does CLR take any options (as in JVM) to optimize the performance of a
mulithreaded application? For exmple increasing heap size.

Not sure what multi-threading has to do with it, but the CLR increases
its heap size as required, like a JVM does. JVMs typically have maximum
heap sizes whereas (AFAIK) the CLR doesn't.
How do I increase performance of the following application (test program)

public class DummyThread{
private Thread thread;
public DummyThread(){
thread = new Thread(new ThreadStart(Run));
}
private void Run(){}
}

class ThreadOverhead
{
static void Main(string[] args)
{
int maxThreads = 1000000;
for (int threads = 0; threads < maxThreads; threads++)
new DummyThread();
}
}

You don't do that - creating a million threads is never going to be a
good idea.
 
Back
Top