Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C017B1156E for ; Tue, 12 Aug 2014 21:24:33 +0000 (UTC) Received: (qmail 50295 invoked by uid 500); 12 Aug 2014 21:24:33 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 50216 invoked by uid 500); 12 Aug 2014 21:24:33 -0000 Mailing-List: contact issues-help@drill.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.incubator.apache.org Delivered-To: mailing list issues@drill.incubator.apache.org Received: (qmail 50201 invoked by uid 99); 12 Aug 2014 21:24:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Aug 2014 21:24:33 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 12 Aug 2014 21:24:32 +0000 Received: (qmail 50029 invoked by uid 99); 12 Aug 2014 21:24:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Aug 2014 21:24:12 +0000 Date: Tue, 12 Aug 2014 21:24:12 +0000 (UTC) From: "Sudheesh Katkam (JIRA)" To: issues@drill.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-1178) Double copy in setSafe for VariableLengthVectors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DRILL-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sudheesh Katkam updated DRILL-1178: ----------------------------------- Attachment: DRILL-1178-removing-second-set.patch > Double copy in setSafe for VariableLengthVectors > ------------------------------------------------ > > Key: DRILL-1178 > URL: https://issues.apache.org/jira/browse/DRILL-1178 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Codegen > Affects Versions: m1 > Reporter: Parth Chandra > Assignee: Sudheesh Katkam > Fix For: 0.5.0 > > Attachments: DRILL-1178-removing-second-set.patch > > > In the code generated for the VariableLengthVectors there appears to be a double copy in the setSafe function that takes a Holder as a parameter. Snippet below is for the VarBinaryVector class. > public boolean setSafe(int index, VarBinaryHolder holder){ > int start = holder.start; > int end = holder.end; > int len = end - start; > > int outputStart = offsetVector.data.getInt(index * 4); > > if(data.capacity() < outputStart + len) { > decrementAllocationMonitor(); > return false; > } > > holder.buffer.getBytes(start, data, outputStart, len); // COPY 1 > if (!offsetVector.getMutator().setSafe( index+1, outputStart + len)) { > return false; > } > set(index, holder); // COPY 2 > return true; > } > if (!offsetVector.getMutator().setSafe( index+1, outputStart + len)) { > return false; > } > set(index, holder); > return true; > } > protected void set(int index, VarBinaryHolder holder){ > int length = holder.end - holder.start; > int currentOffset = offsetVector.getAccessor().get(index); > offsetVector.getMutator().set(index + 1, currentOffset + length); > data.setBytes(currentOffset, holder.buffer, holder.start, length); // COPY 2 > } > The line holder.buffer.getBytes copies from the holder into 'data'. > Then in the set function, the data.setBytes call copies again. -- This message was sent by Atlassian JIRA (v6.2#6252)