R Under development (unstable) (2023-09-11 r85126 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("\npackage {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\RtmpYB7vn2\file2799038da18ce.R" Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 864.9 864.9 864.900 864.9 864.90 864.9 1 subsequent 4.6 4.7 4.917 4.8 4.85 14.5 100 > source(FILE, chdir = FALSE) Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 579.4 579.4 579.400 579.40 579.4 579.4 1 subsequent 5.8 5.9 6.119 5.95 6.0 19.7 100 > source(FILE, chdir = TRUE) Unit: microseconds expr min lq mean median uq max neval first time 468.3 468.3 468.300 468.3 468.3 468.3 1 subsequent 5.8 5.9 6.289 6.0 6.1 18.8 100 > > proc.time() user system elapsed 0.28 0.03 0.65