R Under development (unstable) (2023-10-28 r85429 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\Rtmpu6RkJa\file2056c29073791.R" Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 764.5 764.5 764.50 764.5 764.5 764.5 1 subsequent 4.7 4.8 4.95 4.8 4.9 13.9 100 > source(FILE, chdir = FALSE) Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 602.6 602.6 602.600 602.6 602.6 602.6 1 subsequent 5.9 6.0 6.251 6.1 6.2 20.2 100 > source(FILE, chdir = TRUE) Unit: microseconds expr min lq mean median uq max neval first time 585.3 585.3 585.300 585.3 585.3 585.3 1 subsequent 6.0 6.1 6.355 6.2 6.2 21.7 100 > > proc.time() user system elapsed 0.29 0.07 0.64