1+ # # ----------------- Runtime benchmarks ---------------------------------------------
2+ # TODO : Add runtime benchmarks for StateEstimator
3+
4+
5+ # # ----------------- Allocation benchmarks ------------------------------------------
6+ samples, evals = 1 , 1
7+
8+ skf = SteadyKalmanFilter (linmodel)
9+ SUITE[" allocation" ][" StateEstimator" ][" SteadyKalmanFilter" ][" preparestate!" ] =
10+ @benchmarkable (
11+ preparestate! ($ skf, $ y, $ d),
12+ samples= samples, evals= evals
13+ )
14+ SUITE[" allocation" ][" StateEstimator" ][" SteadyKalmanFilter" ][" updatestate!" ] =
15+ @benchmarkable (
16+ updatestate! ($ skf, $ u, $ y, $ d),
17+ setup= preparestate! ($ skf, $ y, $ d),
18+ samples= samples, evals= evals
19+ )
20+ SUITE[" allocation" ][" StateEstimator" ][" SteadyKalmanFilter" ][" evaloutput" ] =
21+ @benchmarkable (
22+ evaloutput ($ skf, $ d),
23+ setup= preparestate! ($ skf, $ y, $ d),
24+ samples= samples, evals= evals
25+ )
26+
27+ kf = KalmanFilter (linmodel, nint_u= [1 , 1 ], direct= false )
28+ SUITE[" allocation" ][" StateEstimator" ][" KalmanFilter" ][" preparestate!" ] =
29+ @benchmarkable (
30+ preparestate! ($ kf, $ y, $ d),
31+ samples= samples, evals= evals
32+ )
33+ SUITE[" allocation" ][" StateEstimator" ][" KalmanFilter" ][" updatestate!" ] =
34+ @benchmarkable (
35+ updatestate! ($ kf, $ u, $ y, $ d),
36+ setup= preparestate! ($ kf, $ y, $ d),
37+ samples= samples, evals= evals
38+ )
39+
40+ lo = Luenberger (linmodel, nint_u= [1 , 1 ])
41+ SUITE[" allocation" ][" StateEstimator" ][" Luenberger" ][" preparestate!" ] =
42+ @benchmarkable (
43+ preparestate! ($ lo, $ y, $ d),
44+ samples= samples, evals= evals
45+ )
46+ SUITE[" allocation" ][" StateEstimator" ][" Luenberger" ][" updatestate!" ] =
47+ @benchmarkable (
48+ updatestate! ($ lo, $ u, $ y, $ d),
49+ setup= preparestate! ($ lo, $ y, $ d),
50+ samples= samples, evals= evals
51+ )
52+
53+ im = InternalModel (nonlinmodel)
54+ SUITE[" allocation" ][" StateEstimator" ][" InternalModel" ][" preparestate!" ] =
55+ @benchmarkable (
56+ preparestate! ($ im, $ y, $ d),
57+ samples= samples, evals= evals
58+ )
59+ SUITE[" allocation" ][" StateEstimator" ][" InternalModel" ][" updatestate!" ] =
60+ @benchmarkable (
61+ updatestate! ($ im, $ u, $ y, $ d),
62+ setup= preparestate! ($ im, $ y, $ d),
63+ samples= samples, evals= evals
64+ )
65+
66+ ukf = UnscentedKalmanFilter (nonlinmodel)
67+ SUITE[" allocation" ][" StateEstimator" ][" UnscentedKalmanFilter" ][" preparestate!" ] =
68+ @benchmarkable (
69+ preparestate! ($ ukf, $ y, $ d),
70+ samples= samples, evals= evals
71+ )
72+ SUITE[" allocation" ][" StateEstimator" ][" UnscentedKalmanFilter" ][" updatestate!" ] =
73+ @benchmarkable (
74+ updatestate! ($ ukf, $ u, $ y, $ d),
75+ setup= preparestate! ($ ukf, $ y, $ d),
76+ samples= samples, evals= evals
77+ )
78+ SUITE[" allocation" ][" StateEstimator" ][" UnscentedKalmanFilter" ][" evaloutput" ] =
79+ @benchmarkable (
80+ evaloutput ($ ukf, $ d),
81+ setup= preparestate! ($ ukf, $ y, $ d),
82+ samples= samples, evals= evals
83+ )
84+
85+ ekf = ExtendedKalmanFilter (linmodel, nint_u= [1 , 1 ], direct= false )
86+ SUITE[" allocation" ][" StateEstimator" ][" ExtendedKalmanFilter" ][" preparestate!" ] =
87+ @benchmarkable (
88+ preparestate! ($ ekf, $ y, $ d),
89+ samples= samples, evals= evals
90+ )
91+ SUITE[" allocation" ][" StateEstimator" ][" ExtendedKalmanFilter" ][" updatestate!" ] =
92+ @benchmarkable (
93+ updatestate! ($ ekf, $ u, $ y, $ d),
94+ setup= preparestate! ($ ekf, $ y, $ d),
95+ samples= samples, evals= evals
96+ )
0 commit comments