我正在运行此中所示的代码question https://stackoverflow.com/questions/73599180/plot-not-showing-in-julia/73599239。我预计它第二次和第三次运行得更快(第一次运行需要时间来编译代码)。然而,它似乎花费了与第一次相同的时间。我怎样才能让这段代码运行得更快?
编辑:我通过在 Linux 终端上发出命令来运行代码:julia mycode.jl
我尝试按照 @Przemyslaw Szufel 的答案中的说明进行操作,但出现以下错误:
julia> create_sysimage(["Plots"], sysimage_path="sys_plots.so", precompile_execution_file="precompile_plots.jl")
ERROR: MethodError: no method matching create_sysimage(::Array{String,1}; sysimage_path="sys_plots.so", precompile_execution_file="precompile_plots.jl")
Closest candidates are:
create_sysimage() at /home/cardio/.julia/packages/PackageCompiler/2yhCw/src/PackageCompiler.jl:462 got unsupported keyword arguments "sysimage_path", "precompile_execution_file"
create_sysimage(::Union{Array{Symbol,1}, Symbol}; sysimage_path, project, precompile_execution_file, precompile_statements_file, incremental, filter_stdlibs, replace_default, base_sysimage, isapp, julia_init_c_file, version, compat_level, soname, cpu_target, script) at /home/cardio/.julia/packages/PackageCompiler/2yhCw/src/PackageCompiler.jl:462
Stacktrace:
[1] top-level scope at REPL[25]:1
我在 Debian Stable Linux 上使用 Julia:Debian ⛬ julia/1.5.3+dfsg-3