apache / apache/arrow-java

[Java] Potentially inefficient variable-width vector reallocation

Đang mở
#241 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Type: enhancement
Ngôn ngữ chính
Java
Star
94
Fork
152
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
11

Mô tả

In several places in the Java codebase you can see this kind of pattern:
```java

while (vector.getDataBuffer().capacity() < toCapacity) {
vector.reallocDataBuffer();
}
```

In the event that a much larger capacity is requested, this will spuriously make several reallocations (doubling the capacity each time).

It would probably be more efficient to reallocate directly to satisfy the desired capacity.

Coincidentally, there's a `reallocDataBuffer` overload that seems to do just that.

**Reporter**: [Antoine Pitrou](https://issues.apache.org/jira/browse/ARROW-17919) / @pitrou

**Note**: *This issue was originally created as [ARROW-17919](https://issues.apache.org/jira/browse/ARROW-17919). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

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

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xác định các vị trí gọi trong Java lặp trên vector.getDataBuffer().capacity() và gọi reallocDataBuffer(), sau đó kiểm tra overload của reallocDataBuffer nhận một capacity mong muốn. Cập nhật các đường dẫn bị ảnh hưởng để một capacity lớn hơn được yêu cầu được đáp ứng trực tiếp, và xác minh rằng các bài kiểm thử Java liên quan bao quát hành vi tái cấp phát.

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

Đánh giá

Công nghệ
java
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.