You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Kristian Rosenvold <kr...@gmail.com> on 2012/05/11 10:15:16 UTC

Java 7 parallel classloading performance ?

I have been considering fixing classworlds and m3 core to exploit the
parallel classloading abilities of java 7. The idea would be to load
plugin classloaders in parallel to increase performance.

Now I was wondering if anyone has had the chance to play around with
this stuff to see if there's any actual gains to be had ? (Or seen
something...)

Kristian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Java 7 parallel classloading performance ?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
in J7 the lock is done by loaded class where it was synchronized on the
classloader itself before.

- Romain


2012/5/22 Jesse Glick <je...@oracle.com>

> On 05/11/2012 04:15 AM, Kristian Rosenvold wrote:
>
>> I have been considering fixing classworlds and m3 core to exploit the
>> parallel classloading abilities of java 7. The idea would be to load
>> plugin classloaders in parallel to increase performance.
>>
>
> You can load classes in multiple threads in parallel in Java 6 too. No
> special trick, just fork some threads to initialize your plugins and join
> to wait for everything to be ready. Some of the initialization will involve
> class loading, and some will involve other tasks.
>
> AFAIK the only change in Java 7 is that locking can be modified in a way
> that would avoid deadlocks in module systems which permit cyclic
> dependencies, such as OSGi. But that should never happen for Maven plugins
> anyway - the dependency graph should be a DAG.
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.**org<de...@maven.apache.org>
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Java 7 parallel classloading performance ?

Posted by Jesse Glick <je...@oracle.com>.
On 05/11/2012 04:15 AM, Kristian Rosenvold wrote:
> I have been considering fixing classworlds and m3 core to exploit the
> parallel classloading abilities of java 7. The idea would be to load
> plugin classloaders in parallel to increase performance.

You can load classes in multiple threads in parallel in Java 6 too. No special trick, just fork some threads to initialize your plugins and join to wait for everything to 
be ready. Some of the initialization will involve class loading, and some will involve other tasks.

AFAIK the only change in Java 7 is that locking can be modified in a way that would avoid deadlocks in module systems which permit cyclic dependencies, such as OSGi. But 
that should never happen for Maven plugins anyway - the dependency graph should be a DAG.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Java 7 parallel classloading performance ?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

i tried it in openejb and the gain was not visible but classloading is not
an important part of our execution time.

the only issue i got was potential linkageerror in some cases but that's
more a jvm bug i think

- Romain


2012/5/11 Olivier Lamy <ol...@apache.org>

> 2012/5/11 Kristian Rosenvold <kr...@gmail.com>:
> > I have been considering fixing classworlds and m3 core to exploit the
> > parallel classloading abilities of java 7. The idea would be to load
> > plugin classloaders in parallel to increase performance.
> >
> Good idea to test that and see if that improve performance !
> > Now I was wondering if anyone has had the chance to play around with
> > this stuff to see if there's any actual gains to be had ? (Or seen
> > something...)
> Perso nope :-) but interested to help/test.
> >
> > Kristian
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Java 7 parallel classloading performance ?

Posted by Olivier Lamy <ol...@apache.org>.
2012/5/11 Kristian Rosenvold <kr...@gmail.com>:
> I have been considering fixing classworlds and m3 core to exploit the
> parallel classloading abilities of java 7. The idea would be to load
> plugin classloaders in parallel to increase performance.
>
Good idea to test that and see if that improve performance !
> Now I was wondering if anyone has had the chance to play around with
> this stuff to see if there's any actual gains to be had ? (Or seen
> something...)
Perso nope :-) but interested to help/test.
>
> Kristian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org