我正在运行这个问题中展示的代码。我预期第二次和第三次运行会更快(第一次运行需要时间来编译代码)。然而,它似乎花费的时间与第一次相同。如何使这段代码运行更快?
编辑:我通过在Linux终端上输入以下命令来运行代码:
编辑:我通过在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
。
julia mycode.jl
命令,还是在单个 Julia 会话中运行它? - Przemyslaw Szufeljulia mycode.jl
- rnsoRevise.includet
如此描述。 - Sundar R