Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BA23A2693 for ; Sat, 7 May 2011 14:27:54 +0000 (UTC) Received: (qmail 15295 invoked by uid 500); 7 May 2011 14:27:54 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 15257 invoked by uid 500); 7 May 2011 14:27:54 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 15247 invoked by uid 99); 7 May 2011 14:27:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 May 2011 14:27:54 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 74.125.83.173 as permitted sender) Received: from [74.125.83.173] (HELO mail-pv0-f173.google.com) (74.125.83.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 May 2011 14:27:48 +0000 Received: by pvg3 with SMTP id 3so2157858pvg.32 for ; Sat, 07 May 2011 07:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=+U28IYioVxVG0Lrga7UkfRkzp5Y+ckUUsw56b2EtvzA=; b=rEJOJo3QyZvqpNdhUOY+gnPTtKwFFzGl47oCaHxq6M94YRdXqK83hjcyTRUmXabejx SH7iNCpSiYZd66B1CI/xVKHFxAgBcGkhwg6DXlyn+fNiZdHuRF8zW4mtpE8xXUeFsnle T3IMb6tdWiuzYDv5YLQ/PxV8UmvIe4ydMMIOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=w9vmbCGsX9FMypAbuBQGv6/bXTMgUYdnViR9FXXnP3TPEzwo5aCIRRDT7Oxy05saU/ H0mChZayuuQZDO5olIxvkYr/Qltcut2zhrFS6ajpvgSCS9orh9KrUpYkY6tLgcQXz9YK k7h+3yNrTgypxDQkdLgAkTQla9Y0fQ9vW1mv8= Received: by 10.68.63.166 with SMTP id h6mr6324404pbs.42.1304778446086; Sat, 07 May 2011 07:27:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.43.195 with HTTP; Sat, 7 May 2011 07:27:06 -0700 (PDT) In-Reply-To: References: <1304585813761-4372286.post@n5.nabble.com> <4DC26A3F.2060705@sopera.com> <4DC2B8FC.2040109@sopera.com> From: Claus Ibsen Date: Sat, 7 May 2011 16:27:06 +0200 Message-ID: Subject: Re: Conceptual 'correctness' of using Camel Unit Tests To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi I managed to cut more time in camel-core and camel-spring. Now I am down to 21m for camel-core and 7m for camel-spring, when running on my laptop. 1) The trick is to lazy load the type converters. And if you use custom type converters in unit tests, then put them into small packages so Camel dont have to scan 100+ classes because you put them into a package with many unit tests. 2) Another optimizations was to add some more basic converters String -> Integer etc. that we used to have a JDK properties editor to converter for us. But the JDK properties editor is a fallback converter, so what happened normally, would be that camel would do a classpath scan for a String -> Integer type converter, and if still none found, then fallback and use that JDK properties editor. Now by adding those very common used combinations of Integer <-> String etc. then that dont happen and we can rely on the type converters from camel-core, which is now loaded "hardcoded". 3) I also checked if we could optimize loading Camel components, eg it load those component scheme files from META-INF/services/. But there is no speed gain there, as we use a FQN to load the resource from classpath, and that is very fast also. 4) And another optimization was to reduce camel components from using camel-core-test.jar and camel-spring-test.jar as they are very big, and just add up and cause among others type convert scanning to be slower. For example I cut 30s in camel-mina. 5) And I found some unit tests in camel-core which I could cut down time with reducing delays, memory usages, and some sleep as well. That gained about 1m. -- Claus Ibsen ----------------- FuseSource Email: cibsen@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/