private static void CollectStatistics(WorkUnit work, RewriterTaskFactory factory) { for (int chunkSize = MinChunkSize; chunkSize <= MemorySize; chunkSize *= 16) { Console.Out.WriteLine(" {0}, chunk size {1}", factory.Name, chunkSize); long sum = 0; long totClusters = 0; for (int rep = 0; rep < CReps; ++rep) { var sc = new ChunkScanner(work, chunkSize); var(msec, clusters) = sc.DoIt(factory); sum += msec; totClusters += clusters; Console.Out.Write(" {0,7}", msec); Console.Out.Flush(); GC.Collect(); } var avg = sum / (double)CReps; var perInstr = sum * 1000.0 / totClusters; Console.Out.WriteLine(", avg: {0:0.000} msec; {1:0.000} usec/rtl cluster {2,6} clusters;", avg, perInstr, totClusters); } }
public ShingleTask(WorkUnit work, int iStart, int iEnd) : base(work, iStart, iEnd) { rewriters = new Dictionary <int, IEnumerator <RtlInstructionCluster> >(); }
public LinearTask(WorkUnit workUnit, int iStart, int iEnd) : base(workUnit, iStart, iEnd) { }
protected RewriterTask(WorkUnit workUnit, int i, int v) { this.workUnit = workUnit; this.iStart = i; this.iEnd = v; }
public abstract RewriterTask Create(WorkUnit workUnit, int iStart, int iEnd);
public LinearShingleTask(WorkUnit work, int iStart, int iEnd) : base(work, iStart, iEnd) { visited = new bool[iEnd - iStart]; }
public override RewriterTask Create(WorkUnit workUnit, int iStart, int iEnd) { return(new ShingleTask(workUnit, iStart, iEnd)); }
public ChunkScanner(WorkUnit workUnit, int chunkSize) { this.workUnit = workUnit; this.chunkSize = chunkSize; }