[
https://issues.apache.org/jira/browse/DRILL-6202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16433186#comment-16433186
]
ASF GitHub Bot commented on DRILL-6202:
---------------------------------------
Github user parthchandra commented on a diff in the pull request:
https://github.com/apache/drill/pull/1144#discussion_r180598658
--- Diff: exec/vector/src/main/codegen/templates/VariableLengthVectors.java
---
@@ -534,15 +534,11 @@ public void setSafe(int index, byte[] bytes) {
assert index >= 0;
final int currentOffset = offsetVector.getAccessor().get(index);
- offsetVector.getMutator().setSafe(index + 1, currentOffset +
bytes.length);
- try {
- data.setBytes(currentOffset, bytes, 0, bytes.length);
- } catch (IndexOutOfBoundsException e) {
- while (data.capacity() < currentOffset + bytes.length) {
- reAlloc();
- }
- data.setBytes(currentOffset, bytes, 0, bytes.length);
+ while (data.capacity() < currentOffset + bytes.length) {
--- End diff --
I'm on the fence on this one. The change from 18 months ago resulted in a
performance improvement of a few percent for variable length columns. This
change essentially undoes that and takes us back to where we were. It seems
that with the recent changes to batch sizing, we are on the path to eliminating
the realloc behaviour that is part of the performance bottleneck for the
setSafe methods. So, perhaps, it might be ok to let this one stay.
> Deprecate usage of IndexOutOfBoundsException to re-alloc vectors
> ----------------------------------------------------------------
>
> Key: DRILL-6202
> URL: https://issues.apache.org/jira/browse/DRILL-6202
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Vlad Rozov
> Assignee: Vlad Rozov
> Priority: Major
> Fix For: 1.14.0
>
>
> As bounds checking may be enabled or disabled, using
> IndexOutOfBoundsException to resize vectors is unreliable. It works only when
> bounds checking is enabled.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)