Implemented pkAnalysisToDataFrame without saving to csv-file.
Given the exposed .NET methods, data extraction required cell-by-cell processing, resulting in many .NET calls. This repeated crossing of the R/.NET boundary seems to negatively impact performance.
@PavelBal @rwmcintosh : Should we keep this implementation or add a dedicated C# method for bulk data retrieval?
devtools::load_all(".")
sim <- loadTestSimulation("S1")
clearOutputs(sim)
outputs <- "Organism|VenousBlood|*|*"
addOutputs(outputs, sim)
results <- runSimulations(sim)[[1]]
pkAnalyses <- calculatePKAnalyses(results)
library(microbenchmark)
benchmark_results <- microbenchmark(
res1 = pkAnalysesToDataFrame(pkAnalyses), # existing method
res2 = pkAnalysesToDataFrame_(pkAnalyses), # w/o saving to csv
times = 50L
)
benchmark_results
#> Unit: milliseconds
#> expr min lq mean median uq max neval cld
#> res1 28.0700 30.5758 38.41138 31.6742 35.0210 134.4465 50 a
#> res2 84.8444 106.6241 246.30354 135.9451 322.5596 747.7574 50 b
Related to #794
Implemented
pkAnalysisToDataFrame
without saving to csv-file. Given the exposed .NET methods, data extraction required cell-by-cell processing, resulting in many .NET calls. This repeated crossing of the R/.NET boundary seems to negatively impact performance.@PavelBal @rwmcintosh : Should we keep this implementation or add a dedicated C# method for bulk data retrieval?