I’m not sure exactly when this happened, but at some point, running code in the VS Code REPL became incredibly slow. A simple test I’ve been using to verify this is the mul!() function as below, but all code I’ve tried has been significantly slower in the REPL. I’ve tried updating from Windows 10 to Windows 11, uninstalling and reinstalling VS Code, the Julia extension, compulsively keeping everying up to date, and uninstalling almost all other extensions, but so far nothing has helped. My VS Code and Julia Extension are fully up to date (1.95.3 and 1.127.2 respectively), but this has been going on for a couple months, so it doesn’t seem tied to a particular version. Hopefully this is just me doing something dumb, but any advice you can give on how I might figure this out and fix it would be incredibly helpful.
using LinearAlgebra, BenchmarkTools
function testmul!(a,b,c)
mul!(a,b,c)
end
a = rand(10);
b = rand(10,10);
c = rand(10);
@benchmark testmul!(a,b,c)
From the REPL, I get the following:
BenchmarkTools.Trial: 10000 samples with 7 evaluations.
Range (min … max): 4.729 μs … 9.271 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 4.800 μs ┊ GC (median): 0.00%
Time (mean ± σ): 4.818 μs ± 187.393 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
▁▄▆█▄
▂▅█████▁▇▃▃▃▄▄▁▃▂▂▂▂▂▁▁▁▁▂▂▁▁▁▂▂▁▁▂▂▁▂▂▂▁▂▂▂▁▂▂▂▂▂▂▁▂▂▂▂▂▂▂ ▃
4.73 μs Histogram: frequency by time 5.46 μs <
Memory estimate: 0 bytes, allocs estimate: 0.
julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12a (2024-10-16 10:53 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 12 × AMD Ryzen 5 5600X 6-Core Processor
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 12 default, 0 interactive, 6 GC (on 12 virtual cores)
Environment:
JULIA_EDITOR = code
but from a terminal within VS Code, or even outside of VS Code, I get a much faster result, like this one taken from a terminal opened within VS Code:
BenchmarkTools.Trial: 10000 samples with 982 evaluations.
Range (min … max): 62.831 ns … 170.061 ns ┊ GC (min … max): 0.00% … 0.00%
Time (median): 64.969 ns ┊ GC (median): 0.00%
Time (mean ± σ): 65.656 ns ± 4.672 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
▃█▁
▂▂▃▄███▇▅▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ ▂
62.8 ns Histogram: frequency by time 85.2 ns <
Memory estimate: 0 bytes, allocs estimate: 0.
julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12a (2024-10-16 10:53 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 12 × AMD Ryzen 5 5600X 6-Core Processor
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 12 virtual cores)
I’ve also tested it using julia --threads=auto
and the results are the same outside of the REPL despite the different number of threads used.
All of this was done on a fresh environment with the following Project and Manifest
Project:
[6e4b80f9] BenchmarkTools v1.5.0
Manifest:
[6e4b80f9] BenchmarkTools v1.5.0
[682c06a0] JSON v0.21.4
[69de0a69] Parsers v2.8.1
[aea7be01] PrecompileTools v1.2.1
[21216c6a] Preferences v1.4.3
[10745b16] Statistics v1.11.1
[56f22d72] Artifacts v1.11.0
[ade2ca70] Dates v1.11.0
[8f399da3] Libdl v1.11.0
[37e2e46d] LinearAlgebra v1.11.0
[56ddb016] Logging v1.11.0
[a63ad114] Mmap v1.11.0
[de0858da] Printf v1.11.0
[9abbd945] Profile v1.11.0
[9a3f8284] Random v1.11.0
[ea8e919c] SHA v0.7.0
[fa267f1f] TOML v1.0.3
[cf7118a7] UUIDs v1.11.0
[4ec0a83e] Unicode v1.11.0
[e66e0078] CompilerSupportLibraries_jll v1.1.1+0
[4536629a] OpenBLAS_jll v0.3.27+1
[8e850b90] libblastrampoline_jll v5.11.0+0