Managing array memory
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- julia
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu bằng việc xem xét các interface hiện có unsafe_wrap, unsafe_pointer_to_objref, Base._growend! và Base.arrayset!, cũng như cách resize! được sử dụng cho các vector. Xác định xem việc mở rộng, thu nhỏ và cấp phát hiệu quả có thể được cung cấp thông qua một interface đủ tổng quát hay không, sau đó ghi lại phạm vi và lộ trình triển khai cụ thể.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The formal interface for working with an array's memory is currently very limited. We mostly just have ways of accessing preallocated memory (e.g., unsafe_wrap and unsafe_pointer_to_objref). The rest of the time we need to rely on methods like push!/pop!/append!/resize to mutate a Vector down the line. Likewise, if we want to allocate memory for a new array we typically need to wrap a new instance of Array.
A couple reasons we this would be good to have here
- Performance. The necessity to ensure that memory is safely managed also means that each call to something like
resize!has to ensure that we don't create a situation where we are out of bounds. This probably only has minimal overhead in most cases but if we are doing something complicated like merging and or sorting two vectors then we may be callingresize!a lot. I recall this sort of thing coming up a lot when I was trying to work with graph algorithms last year that do a lot of insertion and deletion. - Necessary for creating some interfaces. One of the things that makes the indexing interface so nice is that there are formally defined places for new types to insert and propagate information (e.g., bounds checking). It also makes it easier to optimize indexing. In contrast,
Vectordirectly uses methods that allocate and write to memory (e.g.,Base._growend!andBase.arrayset!) while abstract types typically hope thatresize!works and then usesetindex!.
From where I'm standing it seams like this would be great to have here. The reason this is an issue instead of a PR is mainly because I'm unsure if the implementation for this would be too general or involved for this package. We could always define several methods here like unsafe_grow_end! and unsafe_shrink_end! but these aren't super helpful without implementations that can interact with pointers and references.
@chriselrod, do you think growing/shrinking/allocating memory in an efficient way would require a bunch of LLVM magic or could we do it pretty simply here?
- Ngôn ngữ chính
- Julia
- Star
- 140
- Fork
- 44
- Merge trung bình
- 4 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 5
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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của JuliaArrays/ArrayInterface.jl
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
JuliaArrays/ArrayInterface.jl#499 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
JuliaArrays/ArrayInterface.jl#463 · 5 bình luận · 4 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
JuliaArrays/ArrayInterface.jl#460 · 8 bình luận · 2 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
JuliaArrays/ArrayInterface.jl#397 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
JuliaArrays/ArrayInterface.jl#396 ·
Tất cả issue của JuliaArrays/ArrayInterface.jl
Issue tương tự
-
Register ServerMetrics.jl Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
SciML/ModelingToolkit.jl#5207 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
epiforecasts/BVDOutbreakSize#888 · 1 bình luận ·
-
benchmarks documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100