Hi Jendrik,

thanks for your response. I'm using -Xmx1024m for eclipse (i guess the 
main reason was running findbugs) and also experimented with MaxPermSize 
without any noteworthy difference.

I think i haven't been quite clear in my first message: The first test 
with the eclipse builder on a sample test project with a single class was 
quite fast and promising. Afterwards I applied the builder on our smallest 
"real" subproject, which is not so small indeed ;-)

I liked the idea of enabling checks within the eclipse builder and 
understand that a lot of analysis has to be done to generate all the 
information that is needed. But i'm sorry to say, the time currently 
consumed by the builder is a show-stopper for enabling generally. Maybe i 
keep the builder and run it from time to time manually or write a 
standalone app for checking the code via our build server - the only pity 
is that the feedback comes very late comparing to the direct feedback an 
eclipse builder would give.

Do you have any information, whether such a builder is used in larger 
projects ?

best regards,
Oliver Imlinger




From:
Jendrik Johannes <[email protected]>
To:
Oliver Imlinger <[email protected]>
Cc:
[email protected]
Date:
10.05.2012 10:07
Subject:
Re: [EMFText-Users] Eclipse Builder for Jamopp - performance issues with 
certain calls



Hi Oliver,

The operations getAllSuperClassifiers() and getTarget() can be costly
since they potentially load and iterate over many Java files. This
depends on the complexity and number of linked classes.

If I understand you correctly, you use a minimal Java project with
only a few classes. In this case it shouldn't take as long as you
measured.

Maybe it is a memory issue? How much max memory do you give your
Eclipse ( -Xmx VM parameter)? Did you increase the permanent
generation heap (e.g. setting the VM parameter -XX:MaxPermSize=256M).
This is usually needed when working with JaMoPP and large EMF models
in general.

Cheers
Jendrik

On 7 May 2012 09:33, Oliver Imlinger <[email protected]> wrote:
>
> Hi,
>
> inspired from an article in the german "eclipse magazin" (03/12) i 
started
> to play around a bit with an eclipse builder for checking our code with
> Jamopp. For experiencing with Jamopp i tried to discover whether a 
certain
> method ("C.m()" in the code below) is used in certain subclasses 
(subclasses
> of A or B in the code below).
>
> The good thing first: it worked well for me.
>
> The "not so good" thing: after saving a file, the jamopp builder takes 1 
-
> 45 seconds to process the current file (depending on LOC and 
dependencies /
> subclassing etc.). I'm currently running my analysis on my laptop
> ([email protected], 4GB RAM, Win7, Java6 32 bit). Doing a full build on the
> smallest of our projects takes ~ 10 minutes extra for the jamopp 
analysis
> (ignoring non java and all of our test files already).
>
> Code#1: code for checking whether the current class is a certain 
subclass of
> A or B:
>     CompilationUnit cu = (CompilationUnit) 
resource.getContents().get(0);
>
>     boolean foundClassForAnalysis = false;
>     for (Iterator<ConcreteClassifier> it =
> cu.getClassifiers().get(0).getAllSuperClassifiers().iterator();
> it.hasNext(); ){
>         ConcreteClassifier cc = it.next();
>         if ("A".equals(cc.getName()) || "B".equals(cc.getName())) {
>             foundClassForAnalysis = true;
>             break;
>         }
>     }
>
> Code#2: code for checking whether a certain method is used within this 
class
> ("C.m()"):
>     if (foundClassForAnalysis) {
>         for (Iterator<EObject> i = cu.eAllContents(); i.hasNext(); ) {
>             EObject next = i.next();
>             if (next instanceof MethodCall) {
>                 MethodCall methodCall = (MethodCall) next;
>                 Method method = (Method) methodCall.getTarget();
>                 if ("m".equals(method.getName())) {
>                     ConcreteClassifier methodContainer =
> method.getContainingConcreteClassifier();
>                     if ("C".equals(methodContainer.getName())) {
>                         resource.addWarning("dont use method C.m in
> subclasses of A or B", JavaEProblemType.ANALYSIS_PROBLEM, next);
>                     }
>
> The performance problems are located in these statements (measured with
> timestamps before / after the mentioned calls in the eclipse error log):
> a) Code#1: EList<ConcreteClassifier> allSuperClassifiers =
> cu.getClassifiers().get(0).getAllSuperClassifiers();
> => takes ~6 seconds on the mentioned class (with returning 3 super
> classifiers)
>
> b) Code#2: Method method = (Method) methodCall.getTarget();
> Iterating over cu.eAllContents() takes ~40 seconds (with returning 1850
> elements in cu.eAllContents(), thereof 63 methods).
> Calling methodCall.getTarget() takes up to 15 seconds for each of the 63
> methods.
>
> So my question is whether anyone of you has a "better code" regarding
> performance for my scenario (maybe other method calls return the desired
> information in less time or similar) ?
>
> best regards,
> Oliver Imlinger
>
> _______________________________________________
> emftext-users mailing list
> [email protected]
> http://mail-st.inf.tu-dresden.de/cgi-bin/mailman/listinfo/emftext-users
>



-- 
Dr. Jendrik Johannes
Geschäftsführer
DevBoost GmbH
Birkenau 10
22087 Hamburg

Tel.: +49 178 536 3745
E-Mail: [email protected]

http://www.devboost.de

Postanschrift:
DevBoost GmbH, Rungestraße 22-24, 10179 Berlin

Handelsregister Amtsgericht Berlin (Charlottenburg) HRB 140026


_______________________________________________
emftext-users mailing list
[email protected]
http://mail-st.inf.tu-dresden.de/cgi-bin/mailman/listinfo/emftext-users

Reply via email to