Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pkAnalysisTODataFrame() without saving to csv #1497

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rengelke
Copy link
Member

@rengelke rengelke commented Nov 22, 2024

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?

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

@PavelBal
Copy link
Member

add a dedicated C# method for bulk data retrieval?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants