好吧,我用PackageCompiler把常用的几个包预编译了一下并加入内核,速度可以接受。但是又出问题了,我把PyPlot编译进内核:
using PackageCompiler, DataFrames, PyPlot
create_sysimage(["DataFrames","PyPlot"],sysimage_path="sys_Data_PyPlot.so")
然后设置启动时调用这个内核:
Julia --sysimage "sys_Data_PyPlot.so"
但是进入后出问题了:
julia> using PyPlot
这步很快
julia> plot([1,2],[3,4])
┌ Warning: `vendor()` is deprecated, use `BLAS.get_config()` and inspect the output instead
│ caller = npyinitialize() at numpy.jl:67
└ @ PyCall C:\Users\linlin\.julia\packages\PyCall\L0fLP\src\numpy.jl:67
1-element Vector{PyCall.PyObject}:
PyObject <matplotlib.lines.Line2D object at 0x0000000056CFE4F0>
但是不出图像,要plt.show()
才显示,而且不再显示提示符。
如果用Julia普通进入:
julia> using PyPlot
julia> plot([1,2],[3,4])
┌ Warning: `vendor()` is deprecated, use `BLAS.get_config()` and inspect the output instead
│ caller = npyinitialize() at numpy.jl:67
└ @ PyCall C:\Users\linlin\.julia\packages\PyCall\L0fLP\src\numpy.jl:67
1-element Vector{PyCall.PyObject}:
PyObject <matplotlib.lines.Line2D object at 0x0000000062F9D6A0>
可以正常显示图像,这是为什么?