<div dir="ltr">+1 for JMH<div><br></div><div>Thanks,</div><div>Mohan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 21, 2014 at 7:00 PM, Romain Manni-Bucau <span dir="ltr">&lt;<a href="mailto:rmannibucau@gmail.com" target="_blank">rmannibucau@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hmm should it pass TCKs then? ;) /me is joking<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Romain Manni-Bucau<br>
@rmannibucau<br>
<a href="http://www.tomitribe.com" target="_blank">http://www.tomitribe.com</a><br>
<a href="http://rmannibucau.wordpress.com" target="_blank">http://rmannibucau.wordpress.com</a><br>
<a href="https://github.com/rmannibucau" target="_blank">https://github.com/rmannibucau</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
2014-10-21 15:24 GMT+02:00 Mark Struberg &lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt;:<br>
&gt; Hi!<br>
&gt;<br>
&gt; Yes, I missed that you changed the test target. It is now not testing proxies but how fast ApplicationScoped beans injected into other ApplicationScoped beans work.<br>
&gt;<br>
&gt; I agree that this might be a valid performance optimisation, but people should be aware that this is done. Have seen quite a few &#39;ServiceHolder&#39; with getters to the actual services in projects where CDI gets used in companion with legacy frameworks.<br>
&gt;<br>
&gt; I will add this as another use case to the test suite.<br>
&gt;<br>
&gt; LieGrue,<br>
&gt; strub<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; On Tuesday, 21 October 2014, 14:56, Jozef Hartinger &lt;<a href="mailto:jharting@redhat.com">jharting@redhat.com</a>&gt; wrote:<br>
&gt;&gt; &gt; For certain combinations of scopes this is a perfectly legal<br>
&gt;&gt; optimization ;-) It&#39;s even mentioned in the spec (see 6.5.5).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 10/21/2014 02:46 PM, Mark Struberg wrote:<br>
&gt;&gt;&gt;  Folks, you really scare me a bit!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  I debugged into it and for the first BeanManger#getReference I get a proxy.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  But for all other BeanManager#getReference I get the bare metal<br>
&gt;&gt; SimpleBeanWithoutInterceptor WITHOUT ANY PROXY.<br>
&gt;&gt;&gt;  Can you confirm this?<br>
&gt;&gt;&gt;  If so, then please tell me how you make this Serializable if it gets stored<br>
&gt;&gt; e.g in a Http Session?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  This is just not conform to the CDI spec I fear. I even consider this a<br>
&gt;&gt; blocker bug...<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  LieGrue,<br>
&gt;&gt;&gt;  strub<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  On Tuesday, 21 October 2014, 14:07, Jozef Hartinger<br>
&gt;&gt; &lt;<a href="mailto:jharting@redhat.com">jharting@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;  Btw I&#39;ve run your benchmark locally and observed the following<br>
&gt;&gt; results:<br>
&gt;&gt;&gt;&gt;  OWB 1.2.6: 9827ms<br>
&gt;&gt;&gt;&gt;  Weld 2.2.5.Final: 20ms<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  ;-)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  I did however tweak the test a bit so that Weld&#39;s optimizations can<br>
&gt;&gt; be<br>
&gt;&gt;&gt;&gt;  leveraged[1]. I admit that in certain situations (like your test<br>
&gt;&gt; without<br>
&gt;&gt;&gt;&gt;  my change) Weld performs worse than it should and this is a good input<br>
&gt;&gt;&gt;&gt;  for us.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  As for the NPE you observed not sure what is going on there. Perhaps<br>
&gt;&gt;&gt;&gt;  WeldContextControl implementation in DeltaSpike is not really thread<br>
&gt;&gt; safe?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  Jozef<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  [1] <a href="https://github.com/jharting/cdi-performance/commits/weld" target="_blank">https://github.com/jharting/cdi-performance/commits/weld</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  On 10/21/2014 01:43 PM, Jozef Hartinger wrote:<br>
&gt;&gt;&gt;&gt;&gt;    Hi Mark,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;    thanks for showcasting your new feature. Great to see OWB getting<br>
&gt;&gt;&gt;&gt;&gt;    faster! As for the micro benchmark I suggest that you check out<br>
&gt;&gt; JMH[1].<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;    If you need an input from the Weld team, use<br>
&gt;&gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;    [1] <a href="http://openjdk.java.net/projects/code-tools/jmh/" target="_blank">http://openjdk.java.net/projects/code-tools/jmh/</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;    On 10/21/2014 11:59 AM, Mark Struberg wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;    Hi!<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    Weld folks, I need some help with a micro benchmark:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    You know we&#39;ve talked about disk footprint in SE, so I<br>
&gt;&gt; hacked<br>
&gt;&gt;&gt;&gt;  together a small microbenchmark and as a side effect we also got what<br>
&gt;&gt; is really<br>
&gt;&gt;&gt;&gt;  needed to have CDI running<br>
&gt;&gt;&gt;&gt;&gt;&gt;   <a href="https://github.com/struberg/cdi-performance" target="_blank">https://github.com/struberg/cdi-performance</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    I&#39;m curious about missing some dependency excludes for<br>
&gt;&gt; Weld.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    could you please run<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    $&gt; mvn clean dependency:copy-dependencies<br>
&gt;&gt; -DincludeScope=compile<br>
&gt;&gt;&gt;&gt;  -PWeld -Dweld.version=2.2.5.Final<br>
&gt;&gt;&gt;&gt;&gt;&gt;    $&gt; ls -al target/dependency/<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    and tell me which dependencies can be without having some CDI<br>
&gt;&gt;&gt;&gt;  functionality missing?<br>
&gt;&gt;&gt;&gt;&gt;&gt;    Feel free to pimp the pom and ship a pull request.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    txs and LieGrue,<br>
&gt;&gt;&gt;&gt;&gt;&gt;    strub<br>
&gt;&gt;&gt;&gt;&gt;&gt;    _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt;    cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt;   <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;   <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;    Note that for all code provided on this list, the provider<br>
&gt;&gt; licenses the<br>
&gt;&gt;&gt;&gt;  code under the Apache License, Version 2<br>
&gt;&gt;&gt;&gt;  (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas<br>
&gt;&gt; provided<br>
&gt;&gt;&gt;&gt;  on this list, the provider waives all patent and other intellectual<br>
&gt;&gt; property<br>
&gt;&gt;&gt;&gt;  rights inherent in such information.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;    _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;    cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;   <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;   <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;    Note that for all code provided on this list, the provider<br>
&gt;&gt; licenses the<br>
&gt;&gt;&gt;&gt;  code under the Apache License, Version 2<br>
&gt;&gt;&gt;&gt;  (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas<br>
&gt;&gt; provided<br>
&gt;&gt;&gt;&gt;  on this list, the provider waives all patent and other intellectual<br>
&gt;&gt; property<br>
&gt;&gt;&gt;&gt;  rights inherent in such information.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; cdi-dev mailing list<br>
&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;<br>
&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
</div></div></blockquote></div><br></div>