Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-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 22733F750 for ; Tue, 7 May 2013 12:33:18 +0000 (UTC) Received: (qmail 90043 invoked by uid 500); 7 May 2013 12:33:17 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 89942 invoked by uid 500); 7 May 2013 12:33:16 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 89916 invoked by uid 99); 7 May 2013 12:33:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 May 2013 12:33:16 +0000 Date: Tue, 7 May 2013 12:33:15 +0000 (UTC) From: "Antoine DESSAIGNE (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAMEL-6340) Improve Groovy performance MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Antoine DESSAIGNE created CAMEL-6340: ---------------------------------------- Summary: Improve Groovy performance Key: CAMEL-6340 URL: https://issues.apache.org/jira/browse/CAMEL-6340 Project: Camel Issue Type: Improvement Components: camel-groovy Affects Versions: 2.10.3 Reporter: Antoine DESSAIGNE We noticed some performance issues with the execution of Groovy expression. In the {{GroovyExpression}} the script is parsed 2 times at each evaluation. You'll find attached a patch that caches the parsed-version of the scripts. We did some performance tests with the following definition: {noformat} from("direct:start") .loop(10000) .setBody(new GroovyExpression("request.body + request.getHeader('CamelLoopIndex')")) .to("mock:ignore"); {noformat} We took the average of 5 executions (without the first one): || use case || duration || | default, no cache | 52690ms | | patched, with cache | 1017ms | It's more than 50 times faster which is always nice to have -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira