Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9D8D8200C56 for ; Fri, 31 Mar 2017 01:12:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9C1EB160B98; Thu, 30 Mar 2017 23:12:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 17058160B8B for ; Fri, 31 Mar 2017 01:12:46 +0200 (CEST) Received: (qmail 58500 invoked by uid 500); 30 Mar 2017 23:12:45 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 57952 invoked by uid 99); 30 Mar 2017 23:12:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2017 23:12:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 97E57E024D; Thu, 30 Mar 2017 23:12:44 +0000 (UTC) From: jinfengni To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #704: DRILL-5125: Provide option to use generic code for ... Content-Type: text/plain Message-Id: <20170330231244.97E57E024D@git1-us-west.apache.org> Date: Thu, 30 Mar 2017 23:12:44 +0000 (UTC) archived-at: Thu, 30 Mar 2017 23:12:47 -0000 Github user jinfengni commented on a diff in the pull request: https://github.com/apache/drill/pull/704#discussion_r109058076 --- Diff: exec/vector/src/main/codegen/templates/FixedValueVectors.java --- @@ -281,6 +282,11 @@ public void copyFromSafe(int fromIndex, int thisIndex, ${minor.class}Vector from copyFrom(fromIndex, thisIndex, from); } + @Override + public void copyEntry(int toIndex, ValueVector from, int fromIndex) { + ((${minor.class}Vector) from).data.getBytes(fromIndex * ${type.width}, data, toIndex * ${type.width}, ${type.width}); --- End diff -- Throughout all the value vector classes, this new "copyEntry" method has to explicitly downcast from interface ValueVector to a subclass. Such cast happens for each value copied. I' not sure how performance overhead it could possibly incur : JVM has to check the input type, and raise ClassCastException in case of error. Compared with the existing method, I think cast only happens in doSetup(), which is called for each new schema. Also, "copyEntry" uses data.getBytes(), while copyFromSafe() uses setInt(..., from.data.getInt()). I'm not sure the performance difference comes from the difference of generated code vs generic class, or the difference of the underneath implementation. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---