R Under development (unstable) (2023-12-09 r85665 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > main <- function () + { + FILE <- tempfile(fileext = ".R") + on.exit(unlink(FILE), add = TRUE) + this.path:::.write.code(file = FILE, { + if (requireNamespace("microbenchmark")) { + invisible(loadNamespace("microbenchmark")) + invisible(loadNamespace("this.path")) + print(this.path:::.faster.subsequent.times.test()) + } else cat("\n'package:microbenchmark' is not available :(\n") + }) + cat("\n") + this.path:::.Rscript(c("--default-packages=NULL", "--vanilla", FILE)) + + + cat("\n> source(FILE, chdir = FALSE)\n") + source(FILE, chdir = FALSE) + + + cat("\n> source(FILE, chdir = TRUE)\n") + source(FILE, chdir = TRUE) + } > > > main() "D:/RCompile/recent/R/bin/x64/Rscript.exe" "--default-packages=NULL" "--vanilla" "D:\temp\RtmpsTRPyN\file387c3a3432d6.R" Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 838.6 838.6 838.600 838.6 838.6 838.6 1 subsequent 4.7 4.7 4.957 4.8 4.9 16.6 100 > source(FILE, chdir = FALSE) Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 620.1 620.1 620.100 620.1 620.1 620.1 1 subsequent 5.9 6.1 6.768 6.2 7.1 21.5 100 > source(FILE, chdir = TRUE) Unit: microseconds expr min lq mean median uq max neval first time 508 508.0 508 508.0 508.0 508.0 1 subsequent 6 6.1 7 6.3 6.8 20.4 100 > > proc.time() user system elapsed 0.35 0.04 0.70