[Java] Potentially inefficient variable-width vector reallocation
- 主要言語
- 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