Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 39576 invoked from network); 11 Feb 2010 01:54:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Feb 2010 01:54:52 -0000 Received: (qmail 69319 invoked by uid 500); 11 Feb 2010 01:54:52 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 69222 invoked by uid 500); 11 Feb 2010 01:54:52 -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 69212 invoked by uid 99); 11 Feb 2010 01:54:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 01:54:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 01:54:50 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 37D3A234C052 for ; Wed, 10 Feb 2010 17:54:29 -0800 (PST) Message-ID: <1789815617.199041265853269227.JavaMail.jira@brutus.apache.org> Date: Thu, 11 Feb 2010 01:54:29 +0000 (UTC) From: "Jeff Ichnowski (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (JEXL-97) JEXL parses long expressions with lots of parenthesis slowly In-Reply-To: <1572289403.198461265851230541.JavaMail.jira@brutus.apache.org> 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/JEXL-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeff Ichnowski updated JEXL-97: ------------------------------- Attachment: proposed.patch > JEXL parses long expressions with lots of parenthesis slowly > ------------------------------------------------------------ > > Key: JEXL-97 > URL: https://issues.apache.org/jira/browse/JEXL-97 > Project: Commons JEXL > Issue Type: Bug > Affects Versions: 2.0, 1.1, 1.0 > Environment: Java > Reporter: Jeff Ichnowski > Priority: Minor > Attachments: proposed.patch > > > JEXL's parser uses an unbounded JavaCC LOOKAHEAD to distinguish assignment expressions from other expressions. The result is certain expressions take exponential time to parse. The example snippet below demonstrates the problem. On my machine parsing the expression below takes ~120 seconds. Changing the parser to remove the LOOKAHEAD can get this to parse in milliseconds. The lookahead appears to be in all versions of the parser source. > import org.apache.commons.jexl.Expression; > import org.apache.commons.jexl.ExpressionFactory; > public class SlowParse { > public static void main(String[] args) throws Exception { > String input = > "(((((((((((((((((((((((((z+y)/x)*w)-v)*u)/t)-s)*r)/q)+p)-o)*n)-m)+l)*k)+j)/i)+h)*g)+f)/e)+d)-c)/b)+a)"; > // Make sure everything is loaded... > Expression expr = ExpressionFactory.createExpression(input); > long start = System.nanoTime(); > expr = ExpressionFactory.createExpression(input); > long end = System.nanoTime(); > System.out.printf("Parse took %.1f seconds\n", (end-start)/1e+9); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.