Skip to content

Commit

Permalink
fix benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed May 14, 2024
1 parent 06a4659 commit 002d315
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,33 @@ model = Model(; config...)
###############################################################################################################
# run benchmarks
###############################################################################################################
# times = get_times(model)
# n_steps = length(times)
# suite["simulate!"] = BenchmarkGroup()
# for n_reps ∈ [10, 100, 1000, 10_000]
# suite["simulate!"][n_reps] = @benchmarkable(
# simulate!($model, logger, n_reps),
# setup = (logger = Logger(; n_steps, n_reps = $n_reps); n_reps = $n_reps)
# )
# end
times = get_times(model)
n_steps = length(times)
suite["simulate!"] = BenchmarkGroup()
for n_reps [10, 100, 1000, 10_000]
suite["simulate!"][n_reps] = @benchmarkable(
simulate!($model, logger, n_reps),
setup = (logger = Logger(; n_steps, n_reps = $n_reps); n_reps = $n_reps)
)
end

# Δt = 1 / 100
# n_years = 10
# n_steps = Int(n_years / Δt)
# dist = GBM(; μ = 0.10, σ = 0.10, x0 = 1)
# suite["GBM"] = BenchmarkGroup()
# for n_reps ∈ [10, 100, 1000, 10_000]
# suite["GBM"][n_reps] = @benchmarkable rand($dist, $n_steps, $n_reps; Δt = $Δt)
# end
Δt = 1 / 100
n_years = 10
n_steps = Int(n_years / Δt)
dist = GBM(; μ = 0.10, σ = 0.10, x0 = 1)
suite["GBM"] = BenchmarkGroup()
for n_reps [10, 100, 1000, 10_000]
suite["GBM"][n_reps] = @benchmarkable rand($dist, $n_steps, $n_reps; Δt = $Δt)
end

# Δt = 1 / 100
# n_years = 10
# n_steps = Int(n_years / Δt)
# dist = MvGBM(; μ = [0.10, 0.05], σ = fill(0.05, 2), ρ = [1.0 0.4; 0.4 1], ratios = [0.25, 0.75])
# suite["MvGBM"] = BenchmarkGroup()
# for n_reps ∈ [10, 100, 1000, 10_000]
# suite["MvGBM"][n_reps] = @benchmarkable rand($dist, $n_steps, $n_reps; Δt = $Δt)
# end
Δt = 1 / 100
n_years = 10
n_steps = Int(n_years / Δt)
dist = MvGBM(; μ = [0.10, 0.05], σ = fill(0.05, 2), ρ = [1.0 0.4; 0.4 1], ratios = [0.25, 0.75])
suite["MvGBM"] = BenchmarkGroup()
for n_reps [10, 100, 1000, 10_000]
suite["MvGBM"][n_reps] = @benchmarkable rand($dist, $n_steps, $n_reps; Δt = $Δt)
end

suite["update_income!"] = @benchmarkable(
update_income!($model, 2.5; income_sources),
Expand Down

0 comments on commit 002d315

Please sign in to comment.