示例#1
0
        internal Engine(
            IHost host,
            IResolver resolver,
            Action dummy1Action, Action dummy2Action, Action dummy3Action, Action <long> idleAction, Action <long> mainAction, Job targetJob,
            Action globalSetupAction, Action globalCleanupAction, Action iterationSetupAction, Action iterationCleanupAction, long operationsPerInvoke,
            bool includeMemoryStats, Encoding encoding)
        {
            Host                    = host;
            IdleAction              = idleAction;
            Dummy1Action            = dummy1Action;
            Dummy2Action            = dummy2Action;
            Dummy3Action            = dummy3Action;
            MainAction              = mainAction;
            TargetJob               = targetJob;
            GlobalSetupAction       = globalSetupAction;
            GlobalCleanupAction     = globalCleanupAction;
            IterationSetupAction    = iterationSetupAction;
            IterationCleanupAction  = iterationCleanupAction;
            OperationsPerInvoke     = operationsPerInvoke;
            this.includeMemoryStats = includeMemoryStats;

            Resolver = resolver;
            Encoding = encoding;

            Clock            = targetJob.ResolveValue(InfrastructureMode.ClockCharacteristic, Resolver);
            ForceAllocations = targetJob.ResolveValue(GcMode.ForceCharacteristic, Resolver);
            UnrollFactor     = targetJob.ResolveValue(RunMode.UnrollFactorCharacteristic, Resolver);
            Strategy         = targetJob.ResolveValue(RunMode.RunStrategyCharacteristic, Resolver);
            EvaluateOverhead = targetJob.ResolveValue(AccuracyMode.EvaluateOverheadCharacteristic, Resolver);
            InvocationCount  = targetJob.ResolveValue(RunMode.InvocationCountCharacteristic, Resolver);

            warmupStage = new EngineWarmupStage(this);
            pilotStage  = new EnginePilotStage(this);
            targetStage = new EngineTargetStage(this);
        }
示例#2
0
        internal Engine(
            IHost host,
            Action dummy1Action, Action dummy2Action, Action dummy3Action, Action <long> idleAction, Action <long> mainAction, Job targetJob,
            Action setupAction, Action cleanupAction, long operationsPerInvoke)
        {
            Host = host;
            IsDiagnoserAttached = host.IsDiagnoserAttached;
            IdleAction          = idleAction;
            Dummy1Action        = dummy1Action;
            Dummy2Action        = dummy2Action;
            Dummy3Action        = dummy3Action;
            MainAction          = mainAction;
            TargetJob           = targetJob;
            SetupAction         = setupAction;
            CleanupAction       = cleanupAction;
            OperationsPerInvoke = operationsPerInvoke;

            Resolver = new CompositeResolver(BenchmarkRunnerCore.DefaultResolver, EngineResolver.Instance);

            Clock            = targetJob.ResolveValue(InfrastructureMode.ClockCharacteristic, Resolver);
            ForceAllocations = targetJob.ResolveValue(GcMode.ForceCharacteristic, Resolver);
            UnrollFactor     = targetJob.ResolveValue(RunMode.UnrollFactorCharacteristic, Resolver);
            Strategy         = targetJob.ResolveValue(RunMode.RunStrategyCharacteristic, Resolver);
            EvaluateOverhead = targetJob.ResolveValue(AccuracyMode.EvaluateOverheadCharacteristic, Resolver);
            InvocationCount  = targetJob.ResolveValue(RunMode.InvocationCountCharacteristic, Resolver);

            warmupStage = new EngineWarmupStage(this);
            pilotStage  = new EnginePilotStage(this);
            targetStage = new EngineTargetStage(this);
        }
示例#3
0
 public Engine([NotNull] Action <long> idleAction, [NotNull] Action <long> mainAction)
 {
     IdleAction  = idleAction;
     MainAction  = mainAction;
     pilotStage  = new EnginePilotStage(this);
     warmupStage = new EngineWarmupStage(this);
     targetStage = new EngineTargetStage(this);
     Resolver    = new CompositeResolver(BenchmarkRunnerCore.DefaultResolver, EngineResolver.Instance);
 }
示例#4
0
        internal Engine(Action <long> idleAction, Action <long> mainAction, Job targetJob, Action setupAction, Action cleanupAction, long operationsPerInvoke, bool isDiagnoserAttached)
        {
            IdleAction          = idleAction;
            MainAction          = mainAction;
            TargetJob           = targetJob;
            SetupAction         = setupAction;
            CleanupAction       = cleanupAction;
            OperationsPerInvoke = operationsPerInvoke;
            IsDiagnoserAttached = isDiagnoserAttached;

            Resolver = new CompositeResolver(BenchmarkRunnerCore.DefaultResolver, EngineResolver.Instance);

            Clock            = targetJob.Infrastructure.Clock.Resolve(Resolver);
            ForceAllocations = targetJob.Env.Gc.Force.Resolve(Resolver);
            UnrollFactor     = targetJob.Run.UnrollFactor.Resolve(Resolver);
            Strategy         = targetJob.Run.RunStrategy.Resolve(Resolver);
            EvaluateOverhead = targetJob.Accuracy.EvaluateOverhead.Resolve(Resolver);
            InvocationCount  = targetJob.Run.InvocationCount.Resolve(Resolver);

            warmupStage = new EngineWarmupStage(this);
            pilotStage  = new EnginePilotStage(this);
            targetStage = new EngineTargetStage(this);
        }
示例#5
0
        internal Engine(Action<long> idleAction, Action<long> mainAction, Job targetJob, Action setupAction, Action cleanupAction, long operationsPerInvoke, bool isDiagnoserAttached)
        {
            IdleAction = idleAction;
            MainAction = mainAction;
            TargetJob = targetJob;
            SetupAction = setupAction;
            CleanupAction = cleanupAction;
            OperationsPerInvoke = operationsPerInvoke;
            IsDiagnoserAttached = isDiagnoserAttached;

            Resolver = new CompositeResolver(BenchmarkRunnerCore.DefaultResolver, EngineResolver.Instance);

            Clock = targetJob.ResolveValue(InfrastructureMode.ClockCharacteristic, Resolver);
            ForceAllocations = targetJob.ResolveValue(GcMode.ForceCharacteristic, Resolver);
            UnrollFactor = targetJob.ResolveValue(RunMode.UnrollFactorCharacteristic, Resolver);
            Strategy = targetJob.ResolveValue(RunMode.RunStrategyCharacteristic, Resolver);
            EvaluateOverhead = targetJob.ResolveValue(AccuracyMode.EvaluateOverheadCharacteristic, Resolver);
            InvocationCount = targetJob.ResolveValue(RunMode.InvocationCountCharacteristic, Resolver);

            warmupStage = new EngineWarmupStage(this);
            pilotStage = new EnginePilotStage(this);
            targetStage = new EngineTargetStage(this);
        }