JuliaPy / JuliaPy/PyCall.jl

convert(Vector{Int}, o) is much slower than copy(PyVector{Int}(o))

Đang mở
#90 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
performance
Ngôn ngữ chính
Julia
Star
1.5k
Fork
186
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

As discussed [on julia-users](https://groups.google.com/d/msg/julia-users/1M8wDT0e5h4/qZ2OPaM9Hi4J), the two pathways to converting a Python list to a `Vector{Int}` seem mysteriously different in performance. For example:

``` julia
iv = PyVector(rand(Int16, 10^6))
@time copy!(Array(Int, length(iv)), iv);
@time convert(Vector{Int}, iv.o);
```

yields 3-5× slower performance for the second version on my machine.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start by reproducing the issue's two benchmarks with a PyVector created from rand(Int16, 10^6): copy! into Array(Int, length(iv)) and convert(Vector{Int}, iv.o). Trace the two conversion paths to identify why their performance differs; done means the slower conversion no longer has the reported 3–5× gap, with the benchmark confirming the result.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
julia, python
Lĩnh vực
performance
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.