From 0b677308e3ffbf742880f05cc54da469f3ecc854 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 9 Mar 2018 23:14:39 +0100 Subject: Another rebuild of the static docs Now with rbenchmark installed, to get results for the compiled_models vignette --- docs/articles/compiled_models.html | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'docs/articles/compiled_models.html') diff --git a/docs/articles/compiled_models.html b/docs/articles/compiled_models.html index 9f0b5708..915e5474 100644 --- a/docs/articles/compiled_models.html +++ b/docs/articles/compiled_models.html @@ -9,10 +9,7 @@ - - - - @@ -80,7 +77,7 @@

Performance benefit by using compiled model definitions in mkin

Johannes Ranke

-

2018-03-01

+

2018-03-09

@@ -101,7 +98,7 @@ SFO_SFO <-
if (require(rbenchmark)) {
-  b.1 <- benchmark(
+  b.1 <- benchmark(
     "deSolve, not compiled" = mkinfit(SFO_SFO, FOCUS_2006_D,
                                       solution_type = "deSolve",
                                       use_compiled = FALSE, quiet = TRUE),
@@ -117,10 +114,15 @@ SFO_SFO <- print("R package benchmark is not available")
 }
## Lade nötiges Paket: rbenchmark
-
## Warning in library(package, lib.loc = lib.loc, character.only = TRUE,
-## logical.return = TRUE, : es gibt kein Paket namens 'rbenchmark'
-
## [1] "R package benchmark is not available"
-

We see that using the compiled model is by a factor of around NA faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs.

+
##                    test replications elapsed relative user.self sys.self
+## 3     deSolve, compiled            3   2.044    1.000     2.042        0
+## 1 deSolve, not compiled            3  14.198    6.946    14.185        0
+## 2      Eigenvalue based            3   2.751    1.346     2.747        0
+##   user.child sys.child
+## 3          0         0
+## 1          0         0
+## 2          0         0
+

We see that using the compiled model is by a factor of around 7 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs.

@@ -131,7 +133,7 @@ SFO_SFO <- parent = mkinsub("FOMC", "m1"), m1 = mkinsub( "SFO")) - b.2 <- benchmark( + b.2 <- benchmark( "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, use_compiled = FALSE, quiet = TRUE), "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE), @@ -142,11 +144,14 @@ SFO_SFO <- NA print("R package benchmark is not available") }

-
## Lade nötiges Paket: rbenchmark
-
## Warning in library(package, lib.loc = lib.loc, character.only = TRUE,
-## logical.return = TRUE, : es gibt kein Paket namens 'rbenchmark'
-
## [1] "R package benchmark is not available"
-

Here we get a performance benefit of a factor of NA using the version of the differential equation model compiled from C code!

+
## Successfully compiled differential equation model from auto-generated C code.
+
##                    test replications elapsed relative user.self sys.self
+## 2     deSolve, compiled            3   3.695    1.000     3.692        0
+## 1 deSolve, not compiled            3  31.143    8.428    31.114        0
+##   user.child sys.child
+## 2          0         0
+## 1          0         0
+

Here we get a performance benefit of a factor of 8 using the version of the differential equation model compiled from C code!

This vignette was built with mkin 0.9.46.3 on

## R version 3.4.3 (2017-11-30)
 ## Platform: x86_64-pc-linux-gnu (64-bit)
-- 
cgit v1.2.1