Skip to content

Commit

Permalink
add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebodin committed Jul 22, 2021
1 parent 2bdc9b7 commit 535e6dd
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 70 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Manifest.toml
*.sublime-workspace
*.bat
*.sublime-project
*.json
*.txt
5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name = "Xpress"
uuid = "9e70acf3-d6c9-5be6-b5bd-4e2c73e3e054"
authors = ["Joaquim Dias Garcia <[email protected]>, Dheepak Krishnamurthy <[email protected]>, Jose Daniel Lara <[email protected]>"]
url = "https://github.com/jump-dev/Xpress.jl"
authors = [
"Joaquim Dias Garcia <[email protected]>, Dheepak Krishnamurthy <[email protected]>, Jose Daniel Lara <[email protected]>"]
version = "0.12.3"

[deps]
Expand All @@ -16,8 +15,8 @@ MathOptInterface = "~0.9.20"
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Random"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ current implementation should be considered experimental.

The Julia versions 1.1.x do not work properly with MOI dues to Julia bugs. Hence, these versions are not supported.

## Benchmarking

In the development of Xpress.jl it is useful to benchmark the MOI wrapper code performance.
To perform benchmark we recommend you compare the performance of the master branch aggaints your
implementation. Here we leave an example on how to perform the benchmarks the correct way.

1. before starting your implementation run a baseline benchmark aggainst the branch `master`.
```
git checkout master
julia --project=benchmark benchmark/benchmark.jl --new bench
```
2. While testing your implementation benchmark your approach against the baseline benchmark.
```
git checkout approach_1
julia --project=benchmark benchmark/benchmark.jl --compare bench
```
When you are ready to make a PR please report the `report.txt` file content in the PR.

## Reference:

[FICO optimizer manual](https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML)
40 changes: 0 additions & 40 deletions benchmarks/addconstrs.jl

This file was deleted.

26 changes: 0 additions & 26 deletions benchmarks/addvars.jl

This file was deleted.

38 changes: 38 additions & 0 deletions benchmarks/benchmark.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Xpress

function print_help()
println("""
Usage
benchmark.jl [arg] [name]
[arg]
--new Begin a new benchmark comparison
--compare Run another benchmark and compare to existing
[name] A name for the benchmark test
Examples
git checkout master
julia benchmark.jl --new master
git checkout approach_1
julia benchmark.jl --new approach_1
git checkout approach_2
julia benchmark.jl --compare master
julia benchmark.jl --compare approach_1
""")
end

if length(ARGS) != 2
print_help()
else
const Benchmarks = Xpress.MOI.Benchmarks
const suite = Benchmarks.suite(() -> Xpress.Optimizer())
if ARGS[1] == "--new"
Benchmarks.create_baseline(
suite, ARGS[2]; directory = @__DIR__, verbose = true
)
elseif ARGS[1] == "--compare"
Benchmarks.compare_against_baseline(
suite, ARGS[2]; directory = @__DIR__, verbose = true
)
else
print_help()
end
end
2 changes: 1 addition & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function local_installation()
push!(paths_to_try, @__DIR__)

if haskey(ENV, "XPRESSDIR")
push!(paths_to_try, joinpath(ENV["XPRESSDIR"], Sys.iswindows() ? "bin" : "lib"))
push!(paths_to_try, joinpath(ENV["XPRESSDIR"], Sys.iswindows() ? "bin" : "lib"))
end

global found = false
Expand Down

0 comments on commit 535e6dd

Please sign in to comment.