示例#1
0
        public static void SelfTest()
        {
            var eb = new EstimatorBench();

            eb.GlobalSetup();

            var tolerance = new AlmostEqualFloat(1e-6f);
            var expected  = eb.TestCSharpProduct();
 public void GlobalSetup()
 {
     _estimatorBench = new EstimatorBench
     {
         NumInputs  = NumInputs,
         NumOutputs = NumOutputs
     };
     _estimatorBench.GlobalSetup();
 }
        static void Main()
        {
            // tests
            EstimatorBench.SelfTest();

            // benchmarking
            var job = Job.Default
                      .WithGcServer(true);

            // in-process (need this until I fix the problem of not copying the Rust library to the benchmark output folder)
            job = job.WithToolchain(BenchmarkDotNet.Toolchains.InProcess.NoEmit.InProcessNoEmitToolchain.Instance);

            // limited iterations
            job = job
                  .WithWarmupCount(5)
                  .WithIterationCount(10)
                  .WithIterationTime(TimeInterval.FromMilliseconds(500))
            ;

            var config = DefaultConfig.Instance.AddJob(job);

            BenchmarkRunner.Run <EstimatorBench>(config);
            BenchmarkRunner.Run <EstimatorBenchSizeVariations>(config);
        }