Skip to content

Commit 468f689

Browse files
Merge pull request #275 from asinghvi17/patch-1
use benchmark not btime in brusselator example
2 parents 689d78b + 4cf7c03 commit 468f689

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/src/showcase/brusselator.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,17 @@ assess this performance difference:
252252

253253
```@example bruss
254254
using BenchmarkTools
255-
@btime sol = solve(prob, TRBDF2(), saveat = 0.1);
256-
@btime sol = solve(prob_sparse, TRBDF2(), saveat = 0.1);
255+
@benchmark sol = solve(prob, TRBDF2(), saveat = 0.1);
256+
```
257+
```@example bruss
258+
@benchmark sol = solve(prob_sparse, TRBDF2(), saveat = 0.1);
257259
```
258260

259261
But we can further improve this as well. Instead of just using the default linear solver,
260262
we can change this to a Newton-Krylov method by passing in the GMRES method:
261263

262264
```@example bruss
263-
@btime sol = solve(prob_sparse, TRBDF2(linsolve = KrylovJL_GMRES()), saveat = 0.1);
265+
@benchmark sol = solve(prob_sparse, TRBDF2(linsolve = KrylovJL_GMRES()), saveat = 0.1);
264266
```
265267

266268
But to further improve performance, we can use an iLU preconditioner. This looks like
@@ -277,7 +279,7 @@ function incompletelu(W, du, u, p, t, newW, Plprev, Prprev, solverdata)
277279
Pl, nothing
278280
end
279281
280-
@btime solve(prob_sparse,
282+
@benchmark solve(prob_sparse,
281283
TRBDF2(linsolve = KrylovJL_GMRES(), precs = incompletelu, concrete_jac = true),
282284
save_everystep = false);
283285
```

0 commit comments

Comments
 (0)