Here is the results, changed to @time a = Vector{ComplexF64}(undef, 2^25) to measure allocation time.
For WSL, the results is
0.031786 seconds (2 allocations: 512.000 MiB, 99.88% gc time)
0.336840 seconds
0.048195 seconds
0.046878 seconds
0.031919 seconds (2 allocations: 512.000 MiB, 99.84% gc time)
0.335299 seconds
0.048593 seconds
0.048650 seconds
0.032231 seconds (2 allocations: 512.000 MiB, 99.80% gc time)
0.336596 seconds
0.049577 seconds
0.048941 seconds
0.034741 seconds (2 allocations: 512.000 MiB, 99.87% gc time)
0.334516 seconds
0.049514 seconds
0.049246 seconds
0.031316 seconds (2 allocations: 512.000 MiB, 99.88% gc time)
0.335624 seconds
0.049551 seconds
0.048465 seconds
0.034916 seconds (2 allocations: 512.000 MiB, 99.85% gc time)
0.334452 seconds
0.048894 seconds
0.048763 seconds
And for REPL in windows, the results is
0.041377 seconds (2 allocations: 512.000 MiB, 99.94% gc time)
0.074445 seconds
0.046818 seconds
0.046252 seconds
0.040182 seconds (2 allocations: 512.000 MiB, 99.86% gc time)
0.074390 seconds
0.048710 seconds
0.047181 seconds
0.039944 seconds (2 allocations: 512.000 MiB, 99.94% gc time)
0.075219 seconds
0.047892 seconds
0.046741 seconds
0.039637 seconds (2 allocations: 512.000 MiB, 99.94% gc time)
0.074268 seconds
0.046461 seconds
0.046737 seconds
0.039268 seconds (2 allocations: 512.000 MiB, 99.93% gc time)
0.074602 seconds
0.047076 seconds
0.048861 seconds
0.039869 seconds (2 allocations: 512.000 MiB, 99.94% gc time)
0.074913 seconds
0.048400 seconds
0.048094 seconds
It seems that WSL cost much more times at first time. Is this because WSL is a virtual machine?