From 7b9f11562fa9ab8a023f47e6b99a2562b668e48c Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 8 May 2020 17:36:04 +0200 Subject: Profiling suggests the merge in mkinfit is the bottleneck --- R/mkinfit.R | 3 +++ 1 file changed, 3 insertions(+) (limited to 'R') 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")) -- cgit v1.2.1