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 2B183175CA for ; Tue, 3 Nov 2015 04:24:28 +0000 (UTC) Received: (qmail 26520 invoked by uid 500); 3 Nov 2015 04:24:28 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 26493 invoked by uid 500); 3 Nov 2015 04:24:28 -0000 Mailing-List: contact issues-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 issues@drill.apache.org Received: (qmail 26432 invoked by uid 99); 3 Nov 2015 04:24:28 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 04:24:28 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C8DA12C1F65 for ; Tue, 3 Nov 2015 04:24:27 +0000 (UTC) Date: Tue, 3 Nov 2015 04:24:27 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-3912) Common subexpression elimination in code generation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-3912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14986654#comment-14986654 ] ASF GitHub Bot commented on DRILL-3912: --------------------------------------- Github user StevenMPhillips commented on a diff in the pull request: https://github.com/apache/drill/pull/189#discussion_r43715223 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java --- @@ -106,19 +177,30 @@ public HoldingContainer visitFunctionCall(FunctionCall call, ClassGenerator g @Override public HoldingContainer visitBooleanOperator(BooleanOperator op, ClassGenerator generator) throws RuntimeException { + HoldingContainer hc = getPrevious(op, generator.getMappingSet()); --- End diff -- Okay, I think I can make that change. > Common subexpression elimination in code generation > --------------------------------------------------- > > Key: DRILL-3912 > URL: https://issues.apache.org/jira/browse/DRILL-3912 > Project: Apache Drill > Issue Type: Improvement > Reporter: Steven Phillips > Assignee: Jinfeng Ni > > Drill currently will evaluate the full expression tree, even if there are redundant subtrees. Many of these redundant evaluations can be eliminated by reusing the results from previously evaluated expression trees. > For example, > {code} > select a + 1, (a + 1)* (a - 1) from t > {code} > Will compute the entire (a + 1) expression twice. With CSE, it will only be evaluated once. > The benefit will be reducing the work done when evaluating expressions, as well as reducing the amount of code that is generated, which could also lead to better JIT optimization. -- This message was sent by Atlassian JIRA (v6.3.4#6332)