apache / apache/arrow-java

[Java] Potentially inefficient variable-width vector reallocation

オープン
#241 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
Type: enhancement
主要言語
Java
スター
94
フォーク
152
平均マージ
3日 16時間
マージ済み PR(30日)
11

説明

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.*

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、vector.getDataBuffer().capacity() をループで処理し、reallocDataBuffer() を呼び出している Java の呼び出し箇所を特定します。次に、指定された容量を受け取る reallocDataBuffer のオーバーロードを調べます。要求されたより大きな容量が直接満たされるように影響を受けるパスを更新し、関連する Java テストで再割り当ての動作がカバーされていることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
performance
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。