private static void DoBenchmark() { Timer t = new Timer(); t.Start(); rc = new ReferenceCounted(); for (int i = 0; i < NumIterations; i++) { rc2 = rc; rc3 = rc2; rc = rc3; rc3 = rc; } t.End(); Console.WriteLine("Reference counted: {0}", t.Interval); t.Start(); gc = new TracingGC(); for (int i = 0; i < NumIterations; i++) { gc2 = gc; gc3 = gc2; gc = gc3; gc3 = gc; } t.End(); Console.WriteLine("Tracing GC: {0}", t.Interval); }
private static void DoBenchmark() { Timer t = new Timer(); t.Start(); rc = new ReferenceCounted(); for( int i = 0; i < NumIterations; i++ ) { rc2 = rc; rc3 = rc2; rc = rc3; rc3 = rc; } t.End(); Console.WriteLine( "Reference counted: {0}", t.Interval ); t.Start(); gc = new TracingGC(); for( int i = 0; i < NumIterations; i++ ) { gc2 = gc; gc3 = gc2; gc = gc3; gc3 = gc; } t.End(); Console.WriteLine( "Tracing GC: {0}", t.Interval ); }
public static void DoBenchmark() { Timer t = new Timer(); //~ t.Start(); //~ for( int i = 0; i < NumIterations; i++ ) //~ { //~ ReferenceCounted rc = new ReferenceCounted(); //~ rc.Method(); //~ } //~ t.End(); //~ Console.WriteLine( "Reference counted: {0}", t.Interval ); t.Start(); for( int i = 0; i < NumIterations; i++ ) { TracingGC gc = new TracingGC(); gc.Method(); } t.End(); Console.WriteLine( "Tracing GC: {0}", t.Interval ); }
public static void DoBenchmark() { Timer t = new Timer(); //~ t.Start(); //~ for( int i = 0; i < NumIterations; i++ ) //~ { //~ ReferenceCounted rc = new ReferenceCounted(); //~ rc.Method(); //~ } //~ t.End(); //~ Console.WriteLine( "Reference counted: {0}", t.Interval ); t.Start(); for (int i = 0; i < NumIterations; i++) { TracingGC gc = new TracingGC(); gc.Method(); } t.End(); Console.WriteLine("Tracing GC: {0}", t.Interval); }