func BenchmarkEvaluateMany(b *testing.B) { const ( ni = 2 no = 1000 ) fixture := &fixture{ rule: "closed", target: many(ni, no), surrogate: &algorithm.Surrogate{ Inputs: ni, Outputs: no, }, } fixture.initialize() algorithm, strategy := prepare(fixture) surrogate := algorithm.Compute(fixture.target, strategy) points := generate(surrogate) b.ResetTimer() for i := 0; i < b.N; i++ { algorithm.Evaluate(surrogate, points) } }
func BenchmarkComputeHat(b *testing.B) { fixture := &fixtureHat algorithm, strategy := prepare(fixture) for i := 0; i < b.N; i++ { algorithm.Compute(fixture.target, strategy) } }
func BenchmarkComputeBox(b *testing.B) { fixture := &fixtureBox algorithm, strategy := prepare(fixture) strategy.(*Strategy).lmax = 9 for i := 0; i < b.N; i++ { algorithm.Compute(fixture.target, strategy) } }
func BenchmarkEvaluateHat(b *testing.B) { fixture := &fixtureHat algorithm, strategy := prepare(fixture) surrogate := algorithm.Compute(fixture.target, strategy) points := generate(surrogate) b.ResetTimer() for i := 0; i < b.N; i++ { algorithm.Evaluate(surrogate, points) } }
func BenchmarkComputeMany(b *testing.B) { const ( ni = 2 no = 1000 ) fixture := &fixture{ rule: "closed", target: many(ni, no), surrogate: &algorithm.Surrogate{ Inputs: ni, Outputs: no, }, } fixture.initialize() algorithm, strategy := prepare(fixture) for i := 0; i < b.N; i++ { algorithm.Compute(fixture.target, strategy) } }