Пример #1
0
 private static void ResultsToTxt(FusionBenchmarkResults fusionResults, string fileName)
 {
     TxtHelper.Save(TxtHelper.BenchmarkResToLines(fusionResults.OffOffResults), fileName + "offoff");
     TxtHelper.Save(TxtHelper.BenchmarkResToLines(fusionResults.OffOnResults), fileName + "offon");
     TxtHelper.Save(TxtHelper.BenchmarkResToLines(fusionResults.OnOffResults), fileName + "onoff");
     TxtHelper.Save(TxtHelper.BenchmarkResToLines(fusionResults.OnOnResults), fileName + "onon");
 }
Пример #2
0
        public static BenchmarkResults BenchMarkingWithAllSigners(bool isoptimal, DataSetLoader offlineLoader, DataSetLoader onlineLoader)
        {
            var offlineSigners = offlineLoader.EnumerateSigners().ToList();
            var onlineSigners  = onlineLoader.EnumerateSigners().ToList();

            var benchmark = FusionPipelines.GetBenchmark(offlineSigners, isoptimal);

            var offlinePipeline = FusionPipelines.GetOfflinePipeline();
            var onlinePipeline  = FusionPipelines.GetOnlinePipeline();
            var fusionPipeline  = FusionPipelines.GetFusionPipeline(onlineSigners, false, 0);


            foreach (var offSigner in offlineSigners)
            {
                Console.WriteLine(offSigner.ID + " started at " + DateTime.Now.ToString("h:mm:ss tt"));
                var onSigner = onlineSigners.Find(signer => signer.ID == offSigner.ID);
                Parallel.ForEach(offSigner.Signatures, offSig =>
                {
                    offlinePipeline.Transform(offSig);
                    var onSig          = onSigner.Signatures.Find(sig => sig.ID == offSig.ID);
                    var onToOnPipeline = FusionPipelines.GetHackedOnToOnPipeline(offSig.GetFeature(FusionFeatures.Bounds));
                    onToOnPipeline.Transform(onSig);
                    onlinePipeline.Transform(onSig);
                }
                                 );
                Parallel.ForEach(offSigner.Signatures, offSig =>
                {
                    fusionPipeline.Transform(offSig);
                    onlinePipeline.Transform(offSig);
                }
                                 );


                var listWithOnlySigner = new List <Signer>()
                {
                    offSigner
                };
                var onlySigBenchmark = FusionPipelines.GetBenchmark(listWithOnlySigner, true);
                var onlyRes          = onlySigBenchmark.Execute();
                TxtHelper.Save(TxtHelper.BenchmarkResToLines(onlyRes), "offoff" + offSigner.ID);
            }
            return(benchmark.Execute());
        }
Пример #3
0
 public static void ResultsToTxt(BenchmarkResults results, string fileName)
 {
     TxtHelper.Save(TxtHelper.BenchmarkResToLines(results), fileName);
 }