Skip to content

Commit 5332394

Browse files
authored
Add CI benchmarks (#105)
* Add CI benchmarks * Local benchmark only * Remove CI
1 parent 3246a9b commit 5332394

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
*.json
2+
*.json.tmp
3+
14
# Files generated by invoking Julia with --code-coverage
25
*.jl.cov
36
*.jl.*.cov

benchmark/benchmarks.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using BenchmarkTools
2+
using LinearAlgebra
3+
using SparseMatrixColorings
4+
using SparseArrays
5+
6+
SUITE = BenchmarkGroup()
7+
8+
for structure in [:nonsymmetric, :symmetric],
9+
partition in (structure == :nonsymmetric ? [:column, :row] : [:column]),
10+
decompression in (structure == :nonsymmetric ? [:direct] : [:direct, :substitution]),
11+
n in [10^3],
12+
p in [2 / n, 5 / n]
13+
14+
problem = ColoringProblem(; structure, partition)
15+
algo = GreedyColoringAlgorithm(; decompression)
16+
17+
SUITE[:coloring][structure][partition][decompression]["n=$n"]["p=$p"] = @benchmarkable coloring(
18+
A, $problem, $algo
19+
) setup = ( #
20+
A = sparse(Symmetric(sprand($n, $n, $p)))
21+
)
22+
23+
SUITE[:decompress][structure][partition][decompression]["n=$n"]["p=$p"] = @benchmarkable decompress(
24+
B, result
25+
) setup = ( #
26+
A = sparse(Symmetric(sprand($n, $n, $p)));
27+
result = coloring(A, $problem, $algo);
28+
B = compress(A, result)
29+
)
30+
end

0 commit comments

Comments
 (0)