Skip to content

Commit bced9ea

Browse files
authored
Merge f54c47a into b3c8b0f
2 parents b3c8b0f + f54c47a commit bced9ea

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

.github/workflows/Benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
${{ runner.os }}-test-
3232
${{ runner.os }}-
3333
- name: Install dependencies
34-
run: julia -e 'using Pkg; pkg"add JSON PkgBenchmark BenchmarkCI@0.1"'
34+
run: julia -e 'using Pkg; Pkg.add(["JSON", "PkgBenchmark", "BenchmarkCI"])'
3535
- name: Run benchmarks
3636
run: julia benchmark/run_benchmarks.jl
3737
env:

benchmark/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
3+
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
34
DAQP = "c47d62df-3981-49c8-9651-128b1cd08617"
45
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
56
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"

benchmark/benchmarks.jl

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
using BenchmarkTools
2-
using Random
2+
3+
using ModelPredictiveControl, ControlSystemsBase
4+
Ts = 400.0
5+
sys = [ tf(1.90,[1800.0,1]) tf(1.90,[1800.0,1]) tf(1.90,[1800.0,1]);
6+
tf(-0.74,[800.0,1]) tf(0.74,[800.0,1]) tf(-0.74,[800.0,1]) ]
7+
linmodel = setop!(LinModel(sys, Ts, i_d=[3]), uop=[10,50], yop=[50,30], dop=[5])
8+
u, d = [10, 50], [5]
39

410
const SUITE = BenchmarkGroup()
511

12+
## ================== SimModel benchmarks =========================================
13+
SUITE["SimModel"]["allocation"] = BenchmarkGroup(["allocation"])
14+
SUITE["SimModel"]["allocation"]["updatestate!"] = @benchmarkable(
15+
updatestate!($linmodel, $u, $d),
16+
samples=1
17+
)
18+
SUITE["SimModel"]["allocation"]["evaloutput"] = @benchmarkable(
19+
evaloutput($linmodel, $d),
20+
samples=1
21+
)
22+
23+
## ================== StateEstimator benchmarks ================================
24+
25+
26+
27+
#=
628
SUITE["utf8"] = BenchmarkGroup(["string", "unicode"])
729
teststr = String(join(rand(MersenneTwister(1), 'a':'d', 10^4)))
830
SUITE["utf8"]["replace"] = @benchmarkable replace($teststr, "a" => "b")
@@ -16,10 +38,4 @@ for f in (sin, cos, tan)
1638
SUITE["trigonometry"]["circular"][string(f), x] = @benchmarkable ($f)($x)
1739
end
1840
end
19-
20-
SUITE["trigonometry"]["hyperbolic"] = BenchmarkGroup()
21-
for f in (sin, cos, tan)
22-
for x in (0.0, pi)
23-
SUITE["trigonometry"]["hyperbolic"][string(f), x] = @benchmarkable ($f)($x)
24-
end
25-
end
41+
=#

0 commit comments

Comments
 (0)