Menu

#1236 FindBugs 2.0.x slower that 1.3.8

2.0.3
closed-rejected
None
5
2014-06-19
2013-12-21
No

I've been finding that FindBugs 2.0.x is much slower that 1.3.8 when running on the Ptolemy II source tree. Ptolemy II is fairly large, ohloh says 522K lines of Java.

To replicate:
svn co https://repo.eecs.berkeley.edu/svn-anon/projects/eal/ptII/trunk ptII
cd ptII
./configure

I run findbugs via
cd doc; make findbugs
but for that to work, some editing of the makefile would be necessary.

To run without using make, see the attached files, the command line I used is:
/Users/cxh/src/ptII/vendors/findbugs-2.0.3/bin/findbugs -html:fancy.xsl -maxHeap 2000 -textui -include findbugs-include.xml -exclude findbugs-exclude.xml -project ptII.fbp /Users/cxh/src/ptII

I don't think FindBugs 2.0.x ever completes for me. I did a kill -3 on the Java process and got:

"main" prio=5 tid=7f9374001000 nid=0x10251c000 runnable [10251b000]
java.lang.Thread.State: RUNNABLE
at java.util.ArrayList.size(ArrayList.java:177)
at java.util.AbstractList$Itr.hasNext(AbstractList.java:339)
at edu.umd.cs.findbugs.ba.Frame.copyFrom(Frame.java:580)
at edu.umd.cs.findbugs.ba.FrameDataflowAnalysis.copy(FrameDataflowAnalysis.java:41)
at edu.umd.cs.findbugs.ba.FrameDataflowAnalysis.copy(FrameDataflowAnalysis.java:34)
at edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis.transfer(AbstractDataflowAnalysis.java:116)
at edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:365)
at edu.umd.cs.findbugs.classfile.engine.bcel.ConstantDataflowFactory.analyze(ConstantDataflowFactory.java:34)
at edu.umd.cs.findbugs.classfile.engine.bcel.ConstantDataflowFactory.analyze(ConstantDataflowFactory.java:16)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:389)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:342)
at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:1004)
at edu.umd.cs.findbugs.ba.ClassContext.getConstantDataflow(ClassContext.java:716)
at edu.umd.cs.findbugs.detect.DumbMethodInvocations.analyzeMethod(DumbMethodInvocations.java:63)
at edu.umd.cs.findbugs.detect.DumbMethodInvocations.visitClassContext(DumbMethodInvocations.java:46)
at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:74)
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1209)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:282)
at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:393)
at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1317)

1 Attachments

Discussion

  • Christopher Brooks

    Actually, after running ./configure, ant should be run.

    Below are the commands:
    svn co https://repo.eecs.berkeley.edu/svn-anon/projects/eal/ptII/trunk ptII
    cd ptII
    ./configure
    ant
    cd doc

    /users/cxh/src/ptII/vendors/findbugs-2.0.3/bin/findbugs -html:fancy.xsl -maxHeap 2000 -textui -include findbugs-include.xml -exclude findbugs-exclude.xml -project ptII.fbp /Users/cxh/src/ptII

     
  • William Pugh

    William Pugh - 2013-12-22

    It is essentially the same performance on several benchmarks we look at. I'll look at ptII to try to figure out why it is running slowly on it.

     
  • William Pugh

    William Pugh - 2013-12-22

    OK, ptII.fbp from the tar file is weird as it doesn't list any files to be analyzed. It only lists auxclasspath and srcdir. I can't use that to analyze anything.

    I tried figure out what directories to analyze. The layout of your project is very strange. It doesn't look like you have distinguished locations for classifies, they are just intermingled with all the other files.

    From my attempt at analyzing it, it worked fine with 2.0.3. Maybe a little longer, 420 vs. 380 seconds.

    I'm guessing the problem has to do with what happens when FindBugs comes across jar files as is scans directories. I believe in recent versions it is scanning such jar files, but wasn't in 1.3.8. By just pointing FindBugs at the root directory for ptII, it is probably analyzing all the jar files it finds.

    Am I correct that the ptII directory layout doesn't include any dedicated directories for generated class files?

     
  • Christopher Brooks

    Thanks for taking a look. I use FindBugs quite a bit and have been hoping to use FB 2.x sometime.

    Sorry for the delay, my laptop died while traveling over the holidays. (fun.)

    Yes, the ptII directory layout does not have a dedicated directory for .class files. ptII is a very old project and part of the promise of Java was "write once, run everywhere", so at the time it seemed that putting the .class files adjacent to the .java files made sense from a directory management point of view. PtII predates ant and used make. We had gone through the hell of having separate directories for .o files in Ptolemy Classic, so decided to have the .class files in the same directory as the .java files.

    The ptII.fbp file is auto generated, I can take another run at generating a proper file that is compatible with FindBugs 2.0.

     
  • William Pugh

    William Pugh - 2014-01-08

    If you use -nested:false when invoking FindBugs, it won't open any jar files it finds while scanning the provided directories.

     
  • William Pugh

    William Pugh - 2014-01-08
    • status: open --> pending-rejected
    • assigned_to: William Pugh
     
  • Christopher Brooks

    BTW - just to follow up on this, adding -nested:false solved the problem and I'm now able to run FindBugs-2.0.3.

    I'm all set, this bug can definitely be closed.

    Many thanks for looking in to this.

     
  • Andrey Loskutov

    Andrey Loskutov - 2014-06-19
    • status: pending-rejected --> closed-rejected
     

Log in to post a comment.