Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-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 F077A18DD4 for ; Fri, 22 Jan 2016 22:04:24 +0000 (UTC) Received: (qmail 64098 invoked by uid 500); 22 Jan 2016 21:50:49 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 63858 invoked by uid 500); 22 Jan 2016 21:50:49 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 63372 invoked by uid 99); 22 Jan 2016 21:50:43 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2016 21:50:43 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CC2E52C1F55 for ; Fri, 22 Jan 2016 21:50:39 +0000 (UTC) Date: Fri, 22 Jan 2016 21:50:39 +0000 (UTC) From: "Philippe Mouawad (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (JEXL-186) Performance regression in arithmetic operations compared to JEXL 2.1 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/JEXL-186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15113164#comment-15113164 ] Philippe Mouawad edited comment on JEXL-186 at 1/22/16 9:49 PM: ---------------------------------------------------------------- [~henrib], It's now ok with JMeterArithmetic and debug(false) Bug shouldn't debug be false by default ? Thanks was (Author: pmouawad): [~henrib], it's better but still 6 to 7 times slower. Shouldn't debug be false by default ? > Performance regression in arithmetic operations compared to JEXL 2.1 > -------------------------------------------------------------------- > > Key: JEXL-186 > URL: https://issues.apache.org/jira/browse/JEXL-186 > Project: Commons JEXL > Issue Type: Bug > Affects Versions: 3.0 > Reporter: Philippe Mouawad > Assignee: Henri Biestro > Fix For: Later > > Attachments: PerfJexl2.java, PerfJexl2.java, PerfJexl3.java, PerfJexl3.java > > > Compared to JEXL 2.1.1, arithmetic operations are slower in 3.0. > The culprit is the logic around operators overloading; when the JexlArithmetic does not overload any operator, discovering whether it overloads one is repeated each time an interpreter is created (which is a costly introspection operation). > As a workaround, one ca use an arithmetic that does overload an operator (for instance size) as in: > {code} > public static class JMeterArithmetic extends JexlArithmetic { > public JMeterArithmetic(boolean astrict) { > super(astrict); > } > /** > * A workaround to create an operator overload > * @param jma an improbable parameter class > * @return 1 > */ > public int size(JMeterArithmetic jma) { > return 1; > } > } > {code} > And use an instance of that class at engine creation time as in: > {code} > JexlEngine jexl = new JexlBuilder() > .cache(512) > .silent(true) > .strict(true) > .arithmetic(new JMeterArithmetic(true)) > .create(); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)