Ejemplo n.º 1
0
        public static BenchmarkResults BenchmarkingWithAllSigners(bool isoptimal, DataSetLoader offlineLoader)
        {
            var offlineSigners = offlineLoader.EnumerateSigners().ToList();

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

            var marosPipeline  = FusionPipelines.GetMarosPipeline();
            var onlinePipeline = FusionPipelines.GetOnlinePipeline();

            foreach (var offSigner in offlineSigners)
            {
                try
                {
                    Console.WriteLine(offSigner.ID + " started at " + DateTime.Now.ToString("h:mm:ss tt"));
                    Parallel.ForEach(offSigner.Signatures, offSig =>
                    {
                        marosPipeline.Transform(offSig);
                        onlinePipeline.Transform(offSig);
                    }
                                     );
                    Console.WriteLine(offSigner.ID + " finished at " + DateTime.Now.ToString("h:mm:ss tt"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
            return(benchmark.Execute());
        }
Ejemplo n.º 2
0
        public static BenchmarkResults BenchMarkWithAllSigners(bool isoptimal, DataSetLoader onlineLoader)
        {
            Console.WriteLine("Online - online benchmark started");

            var onlineSigners = onlineLoader.EnumerateSigners().ToList();

            var onlinePipeline = FusionPipelines.GetOnlinePipeline();

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

            foreach (var onSigner in onlineSigners)
            {
                try
                {
                    Parallel.ForEach(onSigner.Signatures, onSig =>
                    {
                        onlinePipeline.Transform(onSig);
                    }
                                     );
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
            return(benchmark.Execute());
        }
Ejemplo n.º 3
0
        public static BenchmarkResults BenchmarkWithSigner(bool isOptimal, Signer signer)
        {
            var benchmark = FusionPipelines.GetBenchmark(new List <Signer> {
                signer
            }, isOptimal);
            var results = benchmark.Execute();

            Resultout(results, signer);
            return(results);
        }
Ejemplo n.º 4
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());
        }
Ejemplo n.º 5
0
        public BenchmarkResults Execute()
        {
            var onlineSigners = OnlineLoader.EnumerateSigners().ToList();

            Parallel.ForEach(onlineSigners, onSigner =>
            {
                try
                {
                    Console.WriteLine(onSigner.ID + " started at " + DateTime.Now.ToString("h:mm:ss tt"));
                    Parallel.ForEach(onSigner.Signatures, onSig => OnlinePipeline.Transform(onSig));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
                             );
            var benchmark = FusionPipelines.GetBenchmark(onlineSigners, IsOptimal);

            return(benchmark.Execute());
        }
Ejemplo n.º 6
0
        public static BenchmarkResults BenchmarkWithAllSigners(bool isOptimal, DataSetLoader offlineLoader, DataSetLoader onlineLoader)
        {
            Console.WriteLine("Hacked online - online benchmark started");

            var onlineSigners  = onlineLoader.EnumerateSigners().ToList();
            var offlineSigners = offlineLoader.EnumerateSigners().ToList();

            var offlinePipeline = FusionPipelines.GetHackedOfflinePipeline();

            var benchmark = FusionPipelines.GetBenchmark(onlineSigners, isOptimal);

            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);
                }
                                 );
            }

            var onlinePipeline = FusionPipelines.GetOnlinePipeline();

            foreach (var onSigner in onlineSigners)
            {
                Parallel.ForEach(onSigner.Signatures, onSig =>
                {
                    onlinePipeline.Transform(onSig);
                }
                                 );
            }
            return(benchmark.Execute());
        }
Ejemplo n.º 7
0
        public static FusionBenchmarkResults BenchMarkingWithAllSigners(bool isoptimal, DataSetLoader offlineLoader, DataSetLoader onlineLoader)
        {
            var offlineSigners = offlineLoader.EnumerateSigners().ToList();
            var onlineSigners  = onlineLoader.EnumerateSigners().ToList();


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

            var offOnSigners = new List <Signer>();
            var onOffSigners = new List <Signer>();

            Parallel.ForEach(offlineSigners, offSigner =>
            {
                try
                {
                    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);
                        onSig.SetFeature <Image <Rgba32> >(FusionFeatures.Image, offSig.GetFeature(FusionFeatures.Image));
                        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 offonSigner = FusionPipelines.GetMixedSigner(offSigner, onSigner);
                    var onoffSigner = FusionPipelines.GetMixedSigner(onSigner, offSigner);
                    offOnSigners.Add(offonSigner);
                    onOffSigners.Add(onoffSigner);
                    Console.WriteLine(offSigner.ID + " finished at " + DateTime.Now.ToString("h:mm:ss tt"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
                             );


            var offoffBenchmark = FusionPipelines.GetBenchmark(offlineSigners, isoptimal);
            var offonBenchmark  = FusionPipelines.GetBenchmark(offOnSigners, isoptimal);
            var onoffBenchamrk  = FusionPipelines.GetBenchmark(onOffSigners, isoptimal);
            var ononBenchmark   = FusionPipelines.GetBenchmark(onlineSigners, isoptimal);


            return(new FusionBenchmarkResults
            {
                OffOffResults = offoffBenchmark.Execute(),
                OffOnResults = offonBenchmark.Execute(),
                OnOffResults = onoffBenchamrk.Execute(),
                OnOnResults = ononBenchmark.Execute()
            });
        }
Ejemplo n.º 8
0
        public FusionBenchmarkResults Execute()
        {
            var offlineSigners = OfflineLoader.EnumerateSigners().ToList();
            var onlineSigners  = OnlineLoader.EnumerateSigners().ToList();

            Console.WriteLine(offlineSigners.Count);
            Console.WriteLine(onlineSigners.Count);
            Console.WriteLine(offlineSigners[0].Signatures.Count);
            Console.WriteLine(onlineSigners[0].Signatures.Count);


            var offOnSigners = new List <Signer>();
            var onOffSigners = new List <Signer>();

            var fusionPipeline = FinalFusionPipelines.GetFusionPipeline(offlineSigners, true, InputBaseSigInputCntID);

            foreach (var offSigner in offlineSigners)
            {
                try
                {
                    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 =>
                    {
                        try
                        {
                            MarosPipeline.Transform(offSig);
                            var onSig = onSigner.Signatures.Find(sig => sig.ID == offSig.ID);
                            onSig.SetFeature <Image <Rgba32> >(FusionFeatures.Image, offSig.GetFeature(FusionFeatures.Image));
                            var onToOnPipeline = FinalFusionPipelines.GetHackedOnToOnPipeline(offSig.GetFeature(FusionFeatures.Bounds));
                            onToOnPipeline.Transform(onSig);
                            OnlinePipeline.Transform(onSig);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                    }
                                     );
                    Parallel.ForEach(offSigner.Signatures, offSig =>
                    {
                        try
                        {
                            fusionPipeline.Transform(offSig);
                            OnlinePipeline.Transform(offSig);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                    }
                                     );

                    var offonSigner = FusionPipelines.GetMixedSigner(offSigner, onSigner);
                    var onoffSigner = FusionPipelines.GetMixedSigner(onSigner, offSigner);
                    offOnSigners.Add(offonSigner);
                    onOffSigners.Add(onoffSigner);


                    Console.WriteLine(offSigner.ID + " finished at " + DateTime.Now.ToString("h:mm:ss tt"));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }

            var offoffBenchmark = FusionPipelines.GetBenchmark(offlineSigners, IsOptimal);
            var offonBenchmark  = FusionPipelines.GetBenchmark(offOnSigners, IsOptimal);
            var onoffBenchamrk  = FusionPipelines.GetBenchmark(onOffSigners, IsOptimal);
            var ononBenchmark   = FusionPipelines.GetBenchmark(onlineSigners, IsOptimal);


            return(new FusionBenchmarkResults
            {
                OffOffResults = offoffBenchmark.Execute(),
                OffOnResults = offonBenchmark.Execute(),
                OnOffResults = onoffBenchamrk.Execute(),
                OnOnResults = ononBenchmark.Execute()
            });
        }