You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a Python user, one second loading time for a small project is painful.
I'm testing a very small example as follows:
module mylib
using TyPython
using TyPython.CPython
@export_pyfunctionsum_along_indices(array::Vector{Cdouble}, indices::Vector{Int32})::Cdouble
s =zero(Cdouble)
for i in indices
s += array[i +1]
endreturn s
end@export_pyfunctionadd(a::Int, b::Int)::Int
a + b
endfunctioninit()
@export_pymodule _mylib begin
sum_along_indices =Pyfunc(sum_along_indices)
add =Pyfunc(add)
endendprecompile(init, ())
end
This seems to be the theoretically fastest loading time:
julia>@timebeginimport Pkg, TyPython; TyPython.CPython.init()
Pkg.activate("mylib"); import mylib; TyPython.CPython.init();mylib.init()
end
Activating project at `C:\Users\TR\Desktop\demo\mylib\mylib`0.973526 seconds (1.72 M allocations:100.042 MiB, 2.27% gc time, 70.02% compilation time)
Py(namespace(sum_along_indices=<built-in function sum_along_indices>, add=<built-in function add>))
So far the extra overhead comes from the following parts, which can be optimized in the future:
As a Python user, one second loading time for a small project is painful.
I'm testing a very small example as follows:
This seems to be the theoretically fastest loading time:
So far the extra overhead comes from the following parts, which can be optimized in the future:
calling interpreted julia to get configuration:
jnumpy/jnumpy/init.py
Lines 112 to 117 in 669e046
calling interpreted julia to get the module name:
jnumpy/jnumpy/apis.py
Line 92 in 669e046
The text was updated successfully, but these errors were encountered: