Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E6BB9200C92 for ; Mon, 29 May 2017 07:30:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E1466160BD8; Mon, 29 May 2017 05:30:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 06AF0160BCC for ; Mon, 29 May 2017 07:30:54 +0200 (CEST) Received: (qmail 98486 invoked by uid 500); 29 May 2017 05:30:53 -0000 Mailing-List: contact dev-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 dev@camel.apache.org Received: (qmail 98474 invoked by uid 99); 29 May 2017 05:30:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2017 05:30:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 19072C030F for ; Mon, 29 May 2017 05:30:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.397 X-Spam-Level: X-Spam-Status: No, score=-2.397 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 4inuuNpwkqK8 for ; Mon, 29 May 2017 05:30:51 +0000 (UTC) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id B48325F3F5 for ; Mon, 29 May 2017 05:30:50 +0000 (UTC) Received: by mail-io0-f176.google.com with SMTP id p24so35763522ioi.0 for ; Sun, 28 May 2017 22:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=/hUNEBsrnvOjRQZGsvq62arltijbTVmMOlfvkN0g3RQ=; b=ctjNFsNY9xy9C6HUus24nJyc1IFEug9aIO9gumOvCkjXnkbSwhCGn0ZjggLRQffLu0 ERQo8y0BmsO3vU52yF6MyfaZjDJET3hlt7IIRnfbeW+4YNK3MZ+pRcbOZyGhvbwp9ZLJ d0/ZUAe7ZkND8g/Op2sISw+b/Hh3d1S/1KRnPM8hiPl9/F9gzyejOH3shwFvDPsr3pKP 0x2V3iteulisVI/ACHCvmdavxzif9BxZAFwI3CGwAdFIObs/8ExL9uq7sqD1gZBdCSte sFW+vlRhwk33K99ngQfboE0Cvgh59kwXCxOyVRCG0OAJx3BNR3edzwporkEGyLCi23q5 Hq9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=/hUNEBsrnvOjRQZGsvq62arltijbTVmMOlfvkN0g3RQ=; b=ZHWDgs1WDaOQQBo++bpTnxVfQTh5pPLEjQ1Is0UwQ03TmXQVzBv1ZPh3PIiBir9/kn OvY/BvZwmGND6Z4/5kv2W0X3cTGECw9P8DG9cQP6Fx3y+oWhKawkN9jHo43gNUHAq4KP 5mS3Kb6CvXVG/WNxjqvmyEyOwowi4eJBgG/PplKH+ECWakDpxor1z3WyVWZt7qXZWf4e 0ppQSfrEZ0Yg3gdq8yODsl5Z9ll30VB7e04Nc5nh/lavZ1xxPqDB5IwjVd0lZJ5R0Vys e/dTEKSbnHLFqU/uMBvvxWiEI0/aNFfS6Hg2AdcBzedBWoN8naJVg1i4CLy/WdgBAc07 a99w== X-Gm-Message-State: AODbwcCvqYMalYvjg/2VcpunKB0c0rlhvefjxuJfVdwmW7kHxjOPsKXl BHDIYPN8Oi/SWr23fg/eNXs4nUuaJkXm X-Received: by 10.107.134.211 with SMTP id q80mr12011877ioi.127.1496035843791; Sun, 28 May 2017 22:30:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.91.130 with HTTP; Sun, 28 May 2017 22:30:43 -0700 (PDT) In-Reply-To: References: From: Luca Burgazzoli Date: Mon, 29 May 2017 07:30:43 +0200 Message-ID: Subject: Re: [HELP] - Profile camel-core for optimization and faster startup To: dev@camel.apache.org Content-Type: text/plain; charset="UTF-8" archived-at: Mon, 29 May 2017 05:30:56 -0000 It may be worth adding a small number of JMH micro benchmarks - not to be used as performances metrics - on camel core so we can spot potential regressions. --- Luca Burgazzoli On Sun, May 28, 2017 at 11:31 AM, Claus Ibsen wrote: > Hi > > I have found some more spots for optimisations which I have committed > over the last couple of days. > > Its been several years since we last did such things last, and I have > to admit we have introduced some code that add more object allocation > and a few performance drawbacks since then. > > So with the help of profilers we should be able to improve the > situation for the Camel 2.20 release. > > I have to give credit to Luca for bring this idea up about making > Camel startup faster and look into the number of objects allocated > etc. Usually Camel has negligible performance overhead in the grand > scheme of things. But we have more fine grained performance statistics > today which records the time taken in every step messages are routed. > This uses the StopWatch object which we frankly create too many new > instances. So by reducing those we can reduce the object allocations > and therefore the JVM GC characteristics. > > In the stuff I have optimised you can find the JIRA tickets with > Optimise as prefix. I usually have attached some screenshots from the > profiler so you can see before vs after situations). > > > We have two areas that can be improved > > 1) startup Camel faster (jndi registry, caffine lru cache, and the > uuid generator is a bit slow in their constructors) > 2) faster routing per message at runtime (potential optimise by > reducing object allocations, turn off some features less/seldom in > use, optimise code logic in hot-spot areas, reduce size of internal > state objects, avoid thread contention from synchronized methods, > etc.) > > > > On Fri, May 26, 2017 at 3:59 PM, Claus Ibsen wrote: >> Hi >> >> We have found a few spots to optimize the camel-core source code for >> thread contention and something else. >> >> You can use a profile tool such as YourKit which is excellent at >> identifying spots and visualizing what goes on in the JVM. >> >> We have used it in the past to optimise stuff. However recently Luca >> asked about making Camel startup faster: >> https://issues.apache.org/jira/browse/CAMEL-11321 >> >> And although fast startup is not excatly the same as runtime >> performance then they are still related. A profile can help identify >> places for improvements. >> >> I have pushed a sample project at >> https://github.com/davsclaus/camel-profile-sample >> >> You can then run this via >> >> mvn spring-boot:run >> >> And then attach YourKit profiler. >> >> However if you use IDEA then you can start YourKit, then from YourKit >> you can choose Integrate with IDE ... and then chose IDEA and then say >> ok even if IDEA is also running. >> >> In IDEA you should see a YourKit icon if you right-click on the >> SampleCamelApplication to run this application, then you can chose >> that to profile, and it run the app with profiler. >> >> You then switch to YourKit and you should start see data. >> To check for thread contention, then select the "Monitor Usage" tab, >> and then click the gear button with the play icon "Start Monitor >> Profile" which then starts capture data. >> >> For YourKit you can request a trial license that works for 2 weeks. >> >> >> -- >> Claus Ibsen >> ----------------- >> http://davsclaus.com @davsclaus >> Camel in Action 2: https://www.manning.com/ibsen2 > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2