<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5297725/230443017-4efdeff0-b3b2-4ed9-9581-4dcf62efdaec.png"><img width="2000" alt="image" src="https://user-images.githubusercontent.com/5297725/230443017-4efdeff0-b3b2-4ed9-9581-4dcf62efdaec.png" style="max-width: 100%;"></a></p>
<p dir="auto">In a recent version of Deno, the time taken to start the repl has increased <em>tremendously</em> in project with <strong>a large node_modules</strong> directory.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="❯ sh -c &quot;hyperfine --warmup=2 $(for deno in ~/.tea/deno.land/v*.*.* /usr/local; do printf &quot;\&quot;$deno/bin/deno repl --eval 'close()'\&quot; &quot;;done)&quot;
Benchmark 1: /Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval 'close()'
  Time (mean ± σ):     190.5 ms ±  36.7 ms    [User: 132.2 ms, System: 43.3 ms]
  Range (min … max):   168.2 ms … 325.3 ms    16 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Benchmark 2: /Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval 'close()'
  Time (mean ± σ):     227.6 ms ±  60.0 ms    [User: 147.0 ms, System: 55.2 ms]
  Range (min … max):   173.6 ms … 375.0 ms    15 runs

Benchmark 3: /Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval 'close()'
  Time (mean ± σ):     197.2 ms ±  25.4 ms    [User: 137.6 ms, System: 46.9 ms]
  Range (min … max):   172.2 ms … 243.7 ms    14 runs

Benchmark 4: /Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval 'close()'
  Time (mean ± σ):     194.1 ms ±  17.9 ms    [User: 138.3 ms, System: 45.2 ms]
  Range (min … max):   177.6 ms … 229.4 ms    14 runs

Benchmark 5: /Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval 'close()'
  Time (mean ± σ):     197.5 ms ±  14.5 ms    [User: 140.7 ms, System: 45.9 ms]
  Range (min … max):   184.1 ms … 227.1 ms    13 runs

Benchmark 6: /Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval 'close()'
  Time (mean ± σ):     203.0 ms ±  11.7 ms    [User: 142.7 ms, System: 48.9 ms]
  Range (min … max):   186.1 ms … 223.1 ms    13 runs

Benchmark 7: /usr/local/bin/deno repl --eval 'close()'
  Time (mean ± σ):      1.098 s ±  0.026 s    [User: 0.459 s, System: 0.186 s]
  Range (min … max):    1.055 s …  1.136 s    10 runs

Summary
  '/Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval 'close()'' ran
    1.02 ± 0.22 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval 'close()''
    1.03 ± 0.24 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval 'close()''
    1.04 ± 0.21 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval 'close()''
    1.07 ± 0.21 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval 'close()''
    1.19 ± 0.39 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval 'close()''
    5.76 ± 1.12 times faster than '/usr/local/bin/deno repl --eval 'close()''

❯ /usr/local/bin/deno --version
deno 1.32.2 (release, x86_64-apple-darwin)
v8 11.2.214.9
typescript 5.0.3"><pre class="notranslate">❯ sh -c <span class="pl-s"><span class="pl-pds">"</span>hyperfine --warmup=2 <span class="pl-s"><span class="pl-pds">$(</span>for deno <span class="pl-k">in</span> <span class="pl-k">~</span>/.tea/deno.land/v<span class="pl-k">*</span>.<span class="pl-k">*</span>.<span class="pl-k">*</span> /usr/local<span class="pl-k">;</span> <span class="pl-k">do</span> <span class="pl-c1">printf</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-cce">\"</span><span class="pl-smi">$deno</span>/bin/deno repl --eval 'close()'<span class="pl-cce">\"</span> <span class="pl-pds">"</span></span><span class="pl-k">;</span>done<span class="pl-pds">)</span></span><span class="pl-pds">"</span></span>
Benchmark 1: /Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     190.5 ms ±  36.7 ms    [User: 132.2 ms, System: 43.3 ms]
  Range (min … max):   168.2 ms … 325.3 ms    16 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might <span class="pl-c1">help</span> to use the <span class="pl-s"><span class="pl-pds">'</span>--warmup<span class="pl-pds">'</span></span> or <span class="pl-s"><span class="pl-pds">'</span>--prepare<span class="pl-pds">'</span></span> options.

Benchmark 2: /Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     227.6 ms ±  60.0 ms    [User: 147.0 ms, System: 55.2 ms]
  Range (min … max):   173.6 ms … 375.0 ms    15 runs

Benchmark 3: /Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     197.2 ms ±  25.4 ms    [User: 137.6 ms, System: 46.9 ms]
  Range (min … max):   172.2 ms … 243.7 ms    14 runs

Benchmark 4: /Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     194.1 ms ±  17.9 ms    [User: 138.3 ms, System: 45.2 ms]
  Range (min … max):   177.6 ms … 229.4 ms    14 runs

Benchmark 5: /Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     197.5 ms ±  14.5 ms    [User: 140.7 ms, System: 45.9 ms]
  Range (min … max):   184.1 ms … 227.1 ms    13 runs

Benchmark 6: /Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     203.0 ms ±  11.7 ms    [User: 142.7 ms, System: 48.9 ms]
  Range (min … max):   186.1 ms … 223.1 ms    13 runs

Benchmark 7: /usr/local/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):      1.098 s ±  0.026 s    [User: 0.459 s, System: 0.186 s]
  Range (min … max):    1.055 s …  1.136 s    10 runs

Summary
  <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> ran
    1.02 ± 0.22 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.03 ± 0.24 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.04 ± 0.21 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.07 ± 0.21 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.19 ± 0.39 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    5.76 ± 1.12 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/usr/local/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>

❯ /usr/local/bin/deno --version
deno 1.32.2 (release, x86_64-apple-darwin)
v8 11.2.214.9
typescript 5.0.3</pre></div>
<p dir="auto">Running the same thing in a directory with no node_modules directory is actually a bit <strong>faster</strong> than previous releases (data very noisy)</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5297725/230444021-ba489dfc-5ca9-43ed-87e8-91652514609f.png"><img width="2000" alt="image" src="https://user-images.githubusercontent.com/5297725/230444021-ba489dfc-5ca9-43ed-87e8-91652514609f.png" style="max-width: 100%;"></a></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="❯ sh -c &quot;hyperfine --warmup=2 $(for deno in ~/.tea/deno.land/v*.*.* /usr/local; do printf &quot;\&quot;$deno/bin/deno repl --eval 'close()'\&quot; &quot;;done)&quot;
Benchmark 1: /Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval 'close()'
  Time (mean ± σ):     228.3 ms ±  39.3 ms    [User: 152.1 ms, System: 59.2 ms]
  Range (min … max):   189.0 ms … 342.1 ms    14 runs

Benchmark 2: /Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval 'close()'
  Time (mean ± σ):     323.6 ms ± 124.2 ms    [User: 180.2 ms, System: 74.3 ms]
  Range (min … max):   222.3 ms … 631.2 ms    11 runs

Benchmark 3: /Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval 'close()'
  Time (mean ± σ):     249.2 ms ±  16.0 ms    [User: 166.6 ms, System: 64.4 ms]
  Range (min … max):   224.1 ms … 273.1 ms    11 runs

Benchmark 4: /Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval 'close()'
  Time (mean ± σ):     239.7 ms ±  28.1 ms    [User: 162.5 ms, System: 59.1 ms]
  Range (min … max):   198.4 ms … 290.8 ms    11 runs

Benchmark 5: /Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval 'close()'
  Time (mean ± σ):     272.1 ms ±  22.0 ms    [User: 181.0 ms, System: 66.5 ms]
  Range (min … max):   230.7 ms … 300.4 ms    10 runs

Benchmark 6: /Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval 'close()'
  Time (mean ± σ):     265.2 ms ±  24.4 ms    [User: 171.9 ms, System: 73.2 ms]
  Range (min … max):   231.0 ms … 293.5 ms    11 runs

Benchmark 7: /usr/local/bin/deno repl --eval 'close()'
  Time (mean ± σ):     182.1 ms ±  14.1 ms    [User: 120.3 ms, System: 43.4 ms]
  Range (min … max):   162.6 ms … 216.8 ms    12 runs

Summary
  '/usr/local/bin/deno repl --eval 'close()'' ran
    1.25 ± 0.24 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval 'close()''
    1.32 ± 0.19 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval 'close()''
    1.37 ± 0.14 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval 'close()''
    1.46 ± 0.18 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval 'close()''
    1.49 ± 0.17 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval 'close()''
    1.78 ± 0.70 times faster than '/Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval 'close()''"><pre class="notranslate">❯ sh -c <span class="pl-s"><span class="pl-pds">"</span>hyperfine --warmup=2 <span class="pl-s"><span class="pl-pds">$(</span>for deno <span class="pl-k">in</span> <span class="pl-k">~</span>/.tea/deno.land/v<span class="pl-k">*</span>.<span class="pl-k">*</span>.<span class="pl-k">*</span> /usr/local<span class="pl-k">;</span> <span class="pl-k">do</span> <span class="pl-c1">printf</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-cce">\"</span><span class="pl-smi">$deno</span>/bin/deno repl --eval 'close()'<span class="pl-cce">\"</span> <span class="pl-pds">"</span></span><span class="pl-k">;</span>done<span class="pl-pds">)</span></span><span class="pl-pds">"</span></span>
Benchmark 1: /Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     228.3 ms ±  39.3 ms    [User: 152.1 ms, System: 59.2 ms]
  Range (min … max):   189.0 ms … 342.1 ms    14 runs

Benchmark 2: /Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     323.6 ms ± 124.2 ms    [User: 180.2 ms, System: 74.3 ms]
  Range (min … max):   222.3 ms … 631.2 ms    11 runs

Benchmark 3: /Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     249.2 ms ±  16.0 ms    [User: 166.6 ms, System: 64.4 ms]
  Range (min … max):   224.1 ms … 273.1 ms    11 runs

Benchmark 4: /Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     239.7 ms ±  28.1 ms    [User: 162.5 ms, System: 59.1 ms]
  Range (min … max):   198.4 ms … 290.8 ms    11 runs

Benchmark 5: /Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     272.1 ms ±  22.0 ms    [User: 181.0 ms, System: 66.5 ms]
  Range (min … max):   230.7 ms … 300.4 ms    10 runs

Benchmark 6: /Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     265.2 ms ±  24.4 ms    [User: 171.9 ms, System: 73.2 ms]
  Range (min … max):   231.0 ms … 293.5 ms    11 runs

Benchmark 7: /usr/local/bin/deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):     182.1 ms ±  14.1 ms    [User: 120.3 ms, System: 43.4 ms]
  Range (min … max):   162.6 ms … 216.8 ms    12 runs

Summary
  <span class="pl-s"><span class="pl-pds">'</span>/usr/local/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> ran
    1.25 ± 0.24 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.26.2/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.32 ± 0.19 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.29.2/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.37 ± 0.14 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.28.3/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.46 ± 0.18 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.31.3/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.49 ± 0.17 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.30.3/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span>
    1.78 ± 0.70 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>/Users/m0c0j7y/.tea/deno.land/v1.27.1/bin/deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span></pre></div>
<p dir="auto">FYI I don't even use Deno for its node compatibility.  I just prefer to use Deno as my default JS REPL, but when I use it in a directory with node_modules it's very <g-emoji class="g-emoji" alias="turtle" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f422.png">🐢</g-emoji></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5297725/230444839-3a15adba-16ab-466f-b9e2-f94b285bfdb7.png"><img width="1138" alt="image" src="https://user-images.githubusercontent.com/5297725/230444839-3a15adba-16ab-466f-b9e2-f94b285bfdb7.png" style="max-width: 100%;"></a></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="❯ hyperfine --warmup=1 &quot;deno repl --eval 'close()'&quot; &quot;printf '.exit\n' | node -i&quot;
Benchmark 1: deno repl --eval 'close()'
  Time (mean ± σ):      1.229 s ±  0.086 s    [User: 0.508 s, System: 0.208 s]
  Range (min … max):    1.147 s …  1.439 s    10 runs

Benchmark 2: printf '.exit\n' | node -i
  Time (mean ± σ):     153.0 ms ±  38.9 ms    [User: 79.3 ms, System: 25.5 ms]
  Range (min … max):    98.5 ms … 259.8 ms    20 runs

Summary
  'printf '.exit\n' | node -i' ran
    8.04 ± 2.12 times faster than 'deno repl --eval 'close()''"><pre class="notranslate">❯ hyperfine --warmup=1 <span class="pl-s"><span class="pl-pds">"</span>deno repl --eval 'close()'<span class="pl-pds">"</span></span> <span class="pl-s"><span class="pl-pds">"</span>printf '.exit\n' | node -i<span class="pl-pds">"</span></span>
Benchmark 1: deno repl --eval <span class="pl-s"><span class="pl-pds">'</span>close()<span class="pl-pds">'</span></span>
  Time (mean ± σ):      1.229 s ±  0.086 s    [User: 0.508 s, System: 0.208 s]
  Range (min … max):    1.147 s …  1.439 s    10 runs

Benchmark 2: <span class="pl-c1">printf</span> <span class="pl-s"><span class="pl-pds">'</span>.exit\n<span class="pl-pds">'</span></span> <span class="pl-k">|</span> node -i
  Time (mean ± σ):     153.0 ms ±  38.9 ms    [User: 79.3 ms, System: 25.5 ms]
  Range (min … max):    98.5 ms … 259.8 ms    20 runs

Summary
  <span class="pl-s"><span class="pl-pds">'</span>printf <span class="pl-pds">'</span></span>.exit<span class="pl-cce">\n</span><span class="pl-s"><span class="pl-pds">'</span> | node -i<span class="pl-pds">'</span></span> ran
    8.04 ± 2.12 <span class="pl-c1">times</span> faster than <span class="pl-s"><span class="pl-pds">'</span>deno repl --eval <span class="pl-pds">'</span></span>close()<span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno 1.32.2 (release, x86_64-unknown-linux-gnu)
v8 11.2.214.9
typescript 5.0.3"><pre class="notranslate"><code class="notranslate">deno 1.32.2 (release, x86_64-unknown-linux-gnu)
v8 11.2.214.9
typescript 5.0.3
</code></pre></div>