R Under development (unstable) (2024-12-17 r87446 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > local({ + FILE.R <- tempfile(fileext = ".R") + on.exit(unlink(FILE.R), add = TRUE) + this.path:::.writeCode(file = FILE.R, { + if (requireNamespace("microbenchmark", quietly = TRUE)) { + 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.R)) + + + cat("\n> source(FILE.R, chdir = FALSE)\n") + source(FILE.R, chdir = FALSE) + + + cat("\n> source(FILE.R, chdir = TRUE)\n") + source(FILE.R, chdir = TRUE) + }) "D:/RCompile/recent/R/bin/x64/Rscript.exe" "--default-packages=NULL" "--vanilla" "D:\temp\2024_12_18_01_55_17_12850\RtmpIroi9b\file128a86eec3383.R" Unit: microseconds expr min lq mean median uq max neval first time 1043.8 1043.8 1043.800 1043.8 1043.8 1043.8 1 subsequent 10.3 10.4 10.832 10.5 10.6 36.1 100 > source(FILE.R, chdir = FALSE) Unit: microseconds expr min lq mean median uq max neval first time 730.5 730.5 730.50 730.5 730.5 730.5 1 subsequent 19.5 22.9 23.73 23.7 24.5 56.6 100 > source(FILE.R, chdir = TRUE) Unit: microseconds expr min lq mean median uq max neval first time 263.2 263.2 263.200 263.2 263.2 263.2 1 subsequent 11.1 11.3 11.826 11.4 11.5 47.8 100 > > proc.time() user system elapsed 0.34 0.06 0.71