aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-05-08 17:36:04 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-05-08 17:36:04 +0200
commit7b9f11562fa9ab8a023f47e6b99a2562b668e48c (patch)
tree1ee12f8b84773781117ce67c96c8e21b7c7a99a2 /R
parentea9b76c667620d75c5aeb4077117e722ed0bc3d6 (diff)
Profiling suggests the merge in mkinfit is the bottleneck
Diffstat (limited to 'R')
-rw-r--r--R/mkinfit.R3
1 files changed, 3 insertions, 0 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index f0738ffc..6cfb88c0 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -587,6 +587,9 @@ mkinfit <- function(mkinmod, observed,
out_long <- mkin_wide_to_long(out, time = "time")
+ # Surprisingly, the next line is the one taking the most time for one, two
+ # or three observed variables if we use compiled ODE models
+ # as evidenced by use of github:hadley/lineprof
cost_data <- merge(observed[c("name", "time", "value")], out_long,
by = c("name", "time"), suffixes = c(".observed", ".predicted"))

Contact - Imprint