Skip to content

Commit c0e5f85

Browse files
committed
fix
1 parent 2606b7c commit c0e5f85

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

benchmark/benchmarks.jl

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,17 @@ const list_problems_PureJuMP = setdiff(list_problems, list_problems_not_PureJuMP
1616
# Run locally with `tune!(SUITE)` and then `run(SUITE)`
1717
const SUITE = BenchmarkGroup()
1818

19-
BenchmarkTools.DEFAULT_PARAMETERS[] = BenchmarkTools.Parameters(
20-
samples = 5, # default ~10k → 3
21-
evals = 1, # run each sample once
22-
# seconds = 0.2, # time budget per benchmark
23-
# gctrial = false, # skip extra GC runs
24-
)
19+
const SAMPLES = 5
20+
const EVALS = 1
2521

2622
SUITE["ADNLPProblems"] = BenchmarkGroup()
2723
SUITE["ADNLPProblems"]["NLP"] = BenchmarkGroup()
2824
SUITE["ADNLPProblems"]["NLP"]["constructor"] = BenchmarkGroup()
2925
SUITE["ADNLPProblems"]["NLP"]["obj"] = BenchmarkGroup()
3026
for pb in list_problems_ADNLPProblems
3127
problem_constructor = getproperty(OptimizationProblems.ADNLPProblems, Symbol(pb))
32-
SUITE["ADNLPProblems"]["NLP"]["constructor"][pb] = @benchmarkable $(problem_constructor)()
33-
SUITE["ADNLPProblems"]["NLP"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) setup = (nlp = $(problem_constructor)())
28+
SUITE["ADNLPProblems"]["NLP"]["constructor"][pb] = @benchmarkable $(problem_constructor)() samples=SAMPLES evals=EVALS
29+
SUITE["ADNLPProblems"]["NLP"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup = (nlp = $(problem_constructor)())
3430
end
3531

3632
SUITE["ADNLPProblems"]["NLS"] = BenchmarkGroup()
@@ -39,16 +35,16 @@ SUITE["ADNLPProblems"]["NLS"]["obj"] = BenchmarkGroup()
3935
list_problems_nls_ADNLPProblems = intersect(Symbol.(OptimizationProblems.meta[OptimizationProblems.meta.objtype .== :least_squares, :name]), list_problems_ADNLPProblems)
4036
for pb in list_problems_nls_ADNLPProblems
4137
problem_constructor = getproperty(OptimizationProblems.ADNLPProblems, Symbol(pb))
42-
SUITE["ADNLPProblems"]["NLS"]["constructor"][pb] = @benchmarkable $(problem_constructor)(use_nls = true)
43-
SUITE["ADNLPProblems"]["NLS"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) setup = (nlp = $(problem_constructor)(use_nls = true))
38+
SUITE["ADNLPProblems"]["NLS"]["constructor"][pb] = @benchmarkable $(problem_constructor)(use_nls = true) samples=SAMPLES evals=EVALS
39+
SUITE["ADNLPProblems"]["NLS"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup = (nlp = $(problem_constructor)(use_nls = true))
4440
end
4541
SUITE["PureJuMP"] = BenchmarkGroup()
4642
SUITE["PureJuMP"]["constructor"] = BenchmarkGroup()
4743
SUITE["PureJuMP"]["obj"] = BenchmarkGroup()
4844
for pb in list_problems_PureJuMP
4945
problem_constructor = getproperty(OptimizationProblems.PureJuMP, Symbol(pb))
50-
SUITE["PureJuMP"]["constructor"][pb] = @benchmarkable $(problem_constructor)()
51-
SUITE["PureJuMP"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) setup = (
46+
SUITE["PureJuMP"]["constructor"][pb] = @benchmarkable $(problem_constructor)() samples=SAMPLES evals=EVALS
47+
SUITE["PureJuMP"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup = (
5248
nlp = MathOptNLPModel($(problem_constructor)())
5349
)
5450
end

0 commit comments

Comments
 (0)