Suzhou-Tongyuan / jnumpy

Writing Python C extensions in Julia within 5 minutes.
MIT License
234 stars 8 forks source link

Reduce the latency of casting Array to ndarray #64

Closed songjhaha closed 2 years ago

songjhaha commented 2 years ago

resolve #63

Use NTuple instead of ShapeType(Union of Tuple), this reduces most of latency:

julia> x = rand(2,2);

julia> @time py_cast(Py, x)
  0.272697 seconds (626.84 k allocations: 34.489 MiB, 4.73% gc time, 61.58% compilation time)
...
codecov-commenter commented 2 years ago

Codecov Report

Merging #64 (3549d52) into main (87a15e9) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #64   +/-   ##
=======================================
  Coverage   60.76%   60.76%           
=======================================
  Files          11       11           
  Lines         915      915           
=======================================
  Hits          556      556           
  Misses        359      359           
Impacted Files Coverage Δ
TyPython/src/CPython.Julia.jl 95.45% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.