Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A941210238 for ; Wed, 25 Jun 2014 14:12:04 +0000 (UTC) Received: (qmail 36999 invoked by uid 500); 25 Jun 2014 14:12:04 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 36941 invoked by uid 500); 25 Jun 2014 14:12:04 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 36922 invoked by uid 99); 25 Jun 2014 14:12:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2014 14:12:03 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pierre.derop@gmail.com designates 209.85.215.46 as permitted sender) Received: from [209.85.215.46] (HELO mail-la0-f46.google.com) (209.85.215.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2014 14:12:00 +0000 Received: by mail-la0-f46.google.com with SMTP id el20so803550lab.33 for ; Wed, 25 Jun 2014 07:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oGzHOamD00JmtMgSXcPT3B2tVZQ/pGAdA93uB8a+orw=; b=GpgOHrl7IegPjBZszeXMEWk/TLiVakb0t9Uu72WQCc8zcxphTPv+di9CG2vQj0TYVA 5ShqdN7yTPMPOL/MPzF/iwN2zwlKwPR1roEWuq3hPoy/L3/fi9O2nmBKahPLrQzcCARQ f46dpHBBthmsjHKNqt32snLluMUoNi5yzXAL5O6p/BRxUItVLHHZdbGgpwPUZL/H59fJ JxKVpdB93hwQkfPEJMUwUd415XtIzJB9f7RGIw5RTQKGpty+Wx7XGf6cHsjc33zGowHX G4aWTTE+5yZf9gomUXJfrJIyq8Pt2EncfilAN1Hb5QqWjUqUJ8QPRIYQ5nxZTmVU+eM1 uG+w== MIME-Version: 1.0 X-Received: by 10.112.53.161 with SMTP id c1mr1133995lbp.86.1403705495814; Wed, 25 Jun 2014 07:11:35 -0700 (PDT) Received: by 10.114.66.81 with HTTP; Wed, 25 Jun 2014 07:11:35 -0700 (PDT) In-Reply-To: References: Date: Wed, 25 Jun 2014 16:11:35 +0200 Message-ID: Subject: Re: IPojo performance benchmark From: Pierre De Rop To: users@felix.apache.org Content-Type: multipart/alternative; boundary=001a11c3a08c7288c604fca9a7a6 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3a08c7288c604fca9a7a6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Guillaume; Thanks for reviewing; But if I should only use three component types, then when creating each component instance, is there a way to configure a given component instance service dependency filter ? May I provide such filter in the dictionary that I pass to the ComponentType.createInstance(Dictionary conf) method ? (like passing a target filter with declarative service ComponentFactory ?). Should I use another iPOJO api (like an iPojo Factory ?) In my scenario, I have for example a first "Artist" instance depending on an "Album" instance with the filter "id=3D1". then another "Artist" instance depending on another "Album" instance, but with service filter "id=3D2", etc ... cheers; /Pierre On Wed, Jun 25, 2014 at 3:42 PM, Guillaume Sauthier (OW2) < guillaume.ow2@gmail.com> wrote: > Maybe I don't fully understand Java 8 style code, but it looks like you'r= e > creating too many PrimitiveComponentType instances, right ? > > In iPOJO, a component type is really like a class, you define its contrac= t > (the provided specification, aka interface), it's properties (with > potential default values), =E2=80=A6 And then, you create instances out o= f 1 > component type (that is a de-facto factory): an instance being a simple > configuration (a dictionnary). > > So, in your benchmark, you should create only 3 PrimitiveComponentType: 1 > for artist, 1 for album and 1 for track. > Then, you'll have to create instances by providing a configuration with > instance specific values (like identifier, ...): > > http://felix.apache.org/ipojo/api/1.11.0/org/apache/felix/ipojo/api/Compo= nentType.html#createInstance(java.util.Dictionary) > > Thanks > =E2=80=94G > Le 25 juin 2014 =C3=A0 12:05:29, Pierre De Rop (pierre.derop@gmail.com) a > =C3=A9crit: > > Hi Clement, > > I finally committed a stress test for dependency manager 4 in > > https://svn.apache.org/repos/asf/felix/sandbox/pderop/dependencymanager-p= rototype/ > > So, I included in it a scenario using iPojo, and it seems that registerin= g > around 300 services seems to take an important amount of time, so you mig= ht > want to look into the scenario test. > > I hope I used the iPojo API correctly, I followed the documentation from > here: > > http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apac= he-felix-ipojo-userguide/apache-felix-ipojo-api.html#a-simple-example > ; > so if you have time to take a look, let me know if there is something wro= ng > with the test and I will correct it. > > The stress test is a subproject of dm and is located in > > http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-proto= type/org.apache.felix.dm.benchmark/ > > I haved added a README here: > > http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-proto= type/org.apache.felix.dm.benchmark/README?view=3Dco > > And the code used to declare iPojo components (using the iPojo API) is > located here: > > > http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-proto= type/org.apache.felix.dm.benchmark/src/org/apache/felix/dm/benchmark/ipojo/= IpojoScenario.java?revision=3D1605212&view=3Dco > > hope this helps (and also that I used correctly the iPojo APi) > > cheers; > /Pierre > > > On Sun, Jun 22, 2014 at 10:36 AM, Clement Escoffier < > clement.escoffier@gmail.com> wrote: > > > Hi, > > > > > > On 22 juin 2014 at 00:14:26, Pierre De Rop (pierre.derop@gmail.com) > wrote: > > > > Hello Clement, > > > > I'm also working on some benchmark related to dependency manager, > > declarative service, and after reading this post, I tried to incorporat= e > a > > scenario using iPojo in my benchmark. > > And it seems that I'm also observing a performance problem. > > > > I will try to commit somewhere my benchmark program soon in my sandbox, > > however, I just made a quick jvisualvm, and it looks like I'm spending = 95 > > % > > of the time in the > > org.apache.felix.ipojo.IPojoFactory$RetryNameGenerator.generate method. > > > > > > That would make sense. This class is ensuring uniqueness, which is > > particularly expensive. It's something quite new, and for sure there ar= e > > room for optimizations. > > > > Clement > > > > > > > > > > > > Here is a stacktrace, if this may help: > > > > "Thread-2" #30 prio=3D5 os_prio=3D0 tid=3D0x635f7c00 nid=3D0x47c1 runna= ble > > [0x62cfd000] > > java.lang.Thread.State: RUNNABLE > > at > > > > > org.apache.felix.ipojo.IPojoFactory$RetryNameGenerator.generate(IPojoFact= ory.java:1149) > > at > > > > > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.= java:302) > > - locked <0x67652198> (a > > java.util.Collections$SynchronizedRandomAccessList) > > - locked <0x95055f50> (a org.apache.felix.ipojo.ComponentFactory) > > at > > > > > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.= java:240) > > at > > > > > org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.jav= a:79) > > at > > > > > org.apache.felix.dm.benchmark.ipojo.IPojoActivator$$Lambda$108/3740909.ap= ply(Unknown > > Source) > > at > > org.apache.felix.dm.benchmark.controller.Helper.lambda$1(Helper.java:85= ) > > at > > > > > org.apache.felix.dm.benchmark.controller.Helper$$Lambda$36/6147827.apply(= Unknown > > Source) > > at > > java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:19= 3) > > at > > > > > java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:= 1359) > > at > > java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) > > at > > > > > java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:5= 02) > > at > > > java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708= ) > > at > > java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) > > at > > java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) > > at > > > > > org.apache.felix.dm.benchmark.ipojo.IPojoActivator.__M_start(IPojoActivat= or.java:96) > > at > > > > > org.apache.felix.dm.benchmark.ipojo.IPojoActivator.start(IPojoActivator.j= ava) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :62) > > at > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43) > > at java.lang.reflect.Method.invoke(Method.java:483) > > at org.apache.felix.ipojo.util.Callback.call(Callback.java:237) > > at org.apache.felix.ipojo.util.Callback.call(Callback.java:193) > > at > > > > > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call= (LifecycleCallback.java:86) > > at > > > > > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandl= er.__M_stateChanged(LifecycleCallbackHandler.java:162) > > at > > > > > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandl= er.stateChanged(LifecycleCallbackHandler.java) > > at > > org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:56= 0) > > at > > org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:440) > > at > > > > > org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.j= ava:179) > > at > > > > > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.= java:319) > > - locked <0x6e5340d0> (a org.apache.felix.ipojo.ComponentFactory) > > at > > > > > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.= java:240) > > at > > > > > org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.jav= a:79) > > at > > org.apache.felix.dm.benchmark.ipojo.Activator.start(Activator.java:31) > > at > > > > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.= java:645) > > at org.apache.felix.framework.Felix.activateBundle(Felix.java:2152) > > at org.apache.felix.framework.Felix.startBundle(Felix.java:2070) > > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976) > > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.sta= rtAndStop(BenchmarkControllerImpl.java:190) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.lam= bda$17(BenchmarkControllerImpl.java:104) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl$$La= mbda$17/24713481.run(Unknown > > Source) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.dur= ationOf(BenchmarkControllerImpl.java:229) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.lam= bda$11(BenchmarkControllerImpl.java:104) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl$$La= mbda$15/17116744.applyAsLong(Unknown > > Source) > > at java.util.stream.LongPipeline$2$1.accept(LongPipeline.java:214) > > at > > > > > java.util.stream.Streams$RangeLongSpliterator.forEachRemaining(Streams.ja= va:235) > > at > > java.util.Spliterator$OfLong.forEachRemaining(Spliterator.java:757) > > at > > java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) > > at > > > > > java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:5= 02) > > at > > java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:576) > > at > > > > > java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.ja= va:255) > > at java.util.stream.LongPipeline.toArray(LongPipeline.java:484) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.lam= bda$2(BenchmarkControllerImpl.java:104) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl$$La= mbda$14/9086622.accept(Unknown > > Source) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.lam= bda$16(BenchmarkControllerImpl.java:169) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl$$La= mbda$11/14120199.accept(Unknown > > Source) > > at java.util.Optional.ifPresent(Optional.java:159) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.lam= bda$4(BenchmarkControllerImpl.java:168) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl$$La= mbda$7/32522449.accept(Unknown > > Source) > > at > > > > > java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.jav= a:948) > > at > > > > > java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:58= 0) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.for= EachScenarioBundle(BenchmarkControllerImpl.java:166) > > at > > > > > org.apache.felix.dm.benchmark.controller.impl.BenchmarkControllerImpl.run= (BenchmarkControllerImpl.java:100) > > at java.lang.Thread.run(Thread.java:745) > > > > I'm using latest released ipojo + java8. > > > > > > (will do my best to commit the benchmark so you can take a look and che= ck > > if my test is wrong or if there is really something to be verified > > somewhere in IPojo). > > > > > > > > cheers; > > /Pierre > > > > > > On Sat, Jun 21, 2014 at 9:49 AM, Clement Escoffier < > > clement.escoffier@gmail.com> wrote: > > > > > Hi, > > > > > > Thanks, > > > > > > I will have a look at it, and come back to you. > > > > > > Clement > > > On 21 juin 2014 at 09:21:46, Xander Uiterlinden (uiterlix@gmail.com) > > > wrote: > > > > > > Hi, > > > > > > A colleague of mine just pointed me at this discussion. I'm one of th= e > > two > > > persons that did the presentation on DM performance on the OSGi devco= n. > > > > > > Regarding iPojo, we included it using the documentation on the site b= ut > > are > > > not iPojo experts. I'd be happy to help in figuring out whether the > > results > > > are due to the tests or to the iPojo implementation itself. > > > > > > The code is at: > > > https://github.com/sandermak/osgi-dm-shootout/tree/master/benchmark > > > > > > Cheers, > > > > > > Xander > > > > > > --001a11c3a08c7288c604fca9a7a6--