camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: [HELP] - Profile camel-core for optimization and faster startup
Date Wed, 05 Jul 2017 07:37:01 GMT

I just pushed some commits that improves a little bit the startup of
Apache Camel. The Caffeine LRUCache will upon initialization block for
150 - 200 millis, which we can do in parallel while Camel is being
started. Before this initialization was always forced when you created
a new instance of DefaultCamelContext which means it was blocking for
any runtime you were using. We now do a special warm-up of the
LRUCache in a separate thread to allow the constructor of
DefaultCamelContext to carry on and continue starting up. This makes
starting Camel on Spring Boot etc faster as there is plenty of Spring
Boot startup happening at the same time.

On Fri, Jun 30, 2017 at 11:56 AM, Claus Ibsen <> wrote:
> Hi
> I found some other rooms for optimisations such as
> - invoking the base of the core type converters faster
> - jmx mbean of processors in the routes is using advice over wrapped
> processor to reduce garbage collection
> - simple language now caches evaluated expressions/predicates which
> yields faster evaluation when nested functions are used
> - reduced the number of objects allocated at runtime to reduce garbage
> collection
> On Fri, Jun 23, 2017 at 8:42 PM, Claus Ibsen <> wrote:
>> Hi
>> Just a little status update, that after a bunch of different
>> optimisations, then the YourKit profiler is now down to showing that
>> the type converter registry and the uuid generator is potential
>> hot-spots, where the former is used a lot and we can optimise the
>> conversions for the core converters which I have logged a ticket
>> about. And the latter generates an string uuid for each exchange which
>> is a little bit long. As its sequencer based and have a fixed prefix,
>> then maybe there is some clever optimisation (essentially only the
>> sequence is different as they share the same prefix/seed). But its
>> already optimise as much by adding two strings together via
>> StringBuilder.
>> 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:
>>> 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
>>> 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
>>> -----------------
>>> @davsclaus
>>> Camel in Action 2:
>> --
>> Claus Ibsen
>> -----------------
>> @davsclaus
>> Camel in Action 2:
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2:

Claus Ibsen
----------------- @davsclaus
Camel in Action 2:

View raw message