A small speedup trick for simple nimscript programs.
On my PC,
echo "Hello, World"
time nim e test.nims
real 0m0.104s
user 0m0.103s
sys 0m0.001s
time nim e -d:nimPreviewSlimSystem test.nims
real 0m0.051s
user 0m0.048s
sys 0m0.001s
Unrelated, in this case, genLiteral and sameConstant consumes almost 10% of the execution time, which will be solved in integers and floats constants use BiTable in VM.
At least for me, timings around a few 10s of milliseconds tend to be fairly polluted by system noise. So, I reproduced your result like this:
touch j.nims
tim "nim e j.nims" "nim e -d:nimPreviewSlimSystem j.nims"
0.055969 +- 0.000034 nim e j.nims
0.026807 +- 0.000071 nim e -d:nimPreviewSlimSystem j.nims
using https://github.com/c-blake/bu/blob/main/tim.nim on an i7-6700k running Linux.
FWIW, if I wedge an echo 3 >/proc/sys/vm/drop_caches in there & run as root, I get 140.5 ms for fat system & 107.3 for slim - still a 1.31X boost (in spite of tactics many would call unfair since in most real scenarios, any OS would have a lot of hot data cached).
As a comparison point maybe interesting to some, the same empty script test with python 3.11 gives about 9.855 +- 0.026 msec, only 2.7X better hot cache. Nice! (Same Python is 93.36 +- 0.45 ms cold cache, only 1.15X better than slim - hardly meaningful, really, and probably gets worse faster with non-empty imports.).
This nimble issue is still a problem for just putting define:nimPreviewSlimSystem in your user nim.cfg and being done with the old world order, AFAICT.