Maven 2.x FindBugs Plugin

Major performance degradation since FindBugs plugin 2.1

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 2.2, 2.3
  • Fix Version/s: 2.3.2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Since FindBugs plugin performance got much worse.
E.g. for a small multimodule project with 3 modules execution time increased from ~50 sec to ~ 1 min 20 sec
For a big project with 30 submodules it increased from ~ 4 min to ~ 8 minutes - i.e. execution time has doubled!

See also MFINDBUGS-104

Activity

Hide
Garvin LeClaire added a comment -

This has to do with changes in the Findbugs analysis. This the Findbugs code and not the plug-in.

Show
Garvin LeClaire added a comment - This has to do with changes in the Findbugs analysis. This the Findbugs code and not the plug-in.
Hide
Christoph Kutzinski added a comment -

As I've written in MFINDBUGS-104 I tried it with the same FindBugs version underneath with plugin 2.1 and it was at the same speed as 2.1 with the bundled FindBugs version.

We suspected that the degradation has to do with the per-module forking of the VM.

Show
Christoph Kutzinski added a comment - As I've written in MFINDBUGS-104 I tried it with the same FindBugs version underneath with plugin 2.1 and it was at the same speed as 2.1 with the bundled FindBugs version. We suspected that the degradation has to do with the per-module forking of the VM.
Hide
Garvin LeClaire added a comment -

Check to make sure you really are using the 1.3.9 version of FindBugs. Other users using Findbugs standalone are noticing a slow down. This is due to some new analysis in Findbugs. The upcoming release has some optimizations.

Show
Garvin LeClaire added a comment - Check to make sure you really are using the 1.3.9 version of FindBugs. Other users using Findbugs standalone are noticing a slow down. This is due to some new analysis in Findbugs. The upcoming release has some optimizations.
Hide
Christoph Kutzinski added a comment -

It prints:
[INFO] [findbugs:findbugs {execution: default-cli}]
[...]
[INFO] Using FindBugs Version: 1.3.9

Looks pretty much to me, like it's really using FindBugs 1.3.9

Show
Christoph Kutzinski added a comment - It prints: [INFO] [findbugs:findbugs {execution: default-cli}] [...] [INFO] Using FindBugs Version: 1.3.9 Looks pretty much to me, like it's really using FindBugs 1.3.9
Hide
Garvin LeClaire added a comment -

Use the fork option to allow a JVM to fork for a findbugs analysis. The default value is true.

Show
Garvin LeClaire added a comment - Use the fork option to allow a JVM to fork for a findbugs analysis. The default value is true.
Hide
Christoph Kutzinski added a comment -

It didn't get any better:

findbugs plugin 2.3.2:

~ 3:30 min (it doesn't make much difference if I use <fork>false</fork> or not)

findbugs plugin 2.1:

~ 1:30 min

Show
Christoph Kutzinski added a comment - It didn't get any better: findbugs plugin 2.3.2: ~ 3:30 min (it doesn't make much difference if I use <fork>false</fork> or not) findbugs plugin 2.1: ~ 1:30 min
Hide
Garvin LeClaire added a comment -

Findbugs changed since 1.3.8 used in the earlier versions. You will need change some of the configuration for your scans. What do you have set for the effort? Do you use any filter files?

Show
Garvin LeClaire added a comment - Findbugs changed since 1.3.8 used in the earlier versions. You will need change some of the configuration for your scans. What do you have set for the effort? Do you use any filter files?
Hide
Christoph Kutzinski added a comment - - edited

Configuration for plugin 2.1 (from mvn help:effective-pom):

 
       <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>2.1</version>
          <dependencies>
            <dependency>
              <groupId>com.google.code.findbugs</groupId>
              <artifactId>findbugs</artifactId>
              <version>1.3.9</version>
              <scope>compile</scope>
            </dependency>
          </dependencies>
          <configuration>
            <findbugsXmlOutput>true</findbugsXmlOutput>
            <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
            <xmlOutput>false</xmlOutput>
            <effort>Default</effort>
            <threshold>Normal</threshold>
            <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
          </configuration>
        </plugin>
Show
Christoph Kutzinski added a comment - - edited Configuration for plugin 2.1 (from mvn help:effective-pom):
 
       <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>2.1</version>
          <dependencies>
            <dependency>
              <groupId>com.google.code.findbugs</groupId>
              <artifactId>findbugs</artifactId>
              <version>1.3.9</version>
              <scope>compile</scope>
            </dependency>
          </dependencies>
          <configuration>
            <findbugsXmlOutput>true</findbugsXmlOutput>
            <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
            <xmlOutput>false</xmlOutput>
            <effort>Default</effort>
            <threshold>Normal</threshold>
            <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
          </configuration>
        </plugin>
Hide
Christoph Kutzinski added a comment -

For 2.3.2 (also effective-pom, of course)

 
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>2.3.2</version>
          <configuration>
            <findbugsXmlOutput>true</findbugsXmlOutput>
            <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
            <xmlOutput>false</xmlOutput>
            <effort>Default</effort>
            <threshold>Normal</threshold>
            <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
            <fork>false</fork>
          </configuration>
        </plugin>
Show
Christoph Kutzinski added a comment - For 2.3.2 (also effective-pom, of course)
 
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>2.3.2</version>
          <configuration>
            <findbugsXmlOutput>true</findbugsXmlOutput>
            <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
            <xmlOutput>false</xmlOutput>
            <effort>Default</effort>
            <threshold>Normal</threshold>
            <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
            <fork>false</fork>
          </configuration>
        </plugin>
Hide
Christoph Kutzinski added a comment -

findsbugs-exclude.xml looks like this:

<FindBugsFilter>
     <Match>
        <!-- exclude all warnings in generated code -->
       <Package name="~ich\.corba.*" />
     </Match>
</FindBugsFilter>
Show
Christoph Kutzinski added a comment - findsbugs-exclude.xml looks like this:
<FindBugsFilter>
     <Match>
        <!-- exclude all warnings in generated code -->
       <Package name="~ich\.corba.*" />
     </Match>
</FindBugsFilter>
Hide
Garvin LeClaire added a comment -

Our project with a high threshold did not slow on version 1.3.9 but medium or normal did. It can vary by the project and code size.
After that the plugin does not have any control on the length of time findbugs takes. The fork option typically will only affect multimodule projects with a small amount of code to check in each module.
You can use the 2.3.3-SNAPSHOT version and set the trace option for findbugs to get output of the findbugs run.

Show
Garvin LeClaire added a comment - Our project with a high threshold did not slow on version 1.3.9 but medium or normal did. It can vary by the project and code size. After that the plugin does not have any control on the length of time findbugs takes. The fork option typically will only affect multimodule projects with a small amount of code to check in each module. You can use the 2.3.3-SNAPSHOT version and set the trace option for findbugs to get output of the findbugs run.
Hide
Christoph Kutzinski added a comment -

Sorry, but I didn't understand, why you think that's not a bug.
I'm using Findbugs 1.3.9 in both cases and have the same effort and threshold in both cases.
In fact, you've also admitted that it did slow down for you with medium and normal threshold.

So IMO there must be some difference how the maven plugin controls FindBugs, mustn't it?
Otherwise I couldn't explain how that time difference could be.

Show
Christoph Kutzinski added a comment - Sorry, but I didn't understand, why you think that's not a bug. I'm using Findbugs 1.3.9 in both cases and have the same effort and threshold in both cases. In fact, you've also admitted that it did slow down for you with medium and normal threshold. So IMO there must be some difference how the maven plugin controls FindBugs, mustn't it? Otherwise I couldn't explain how that time difference could be.
Hide
Garvin LeClaire added a comment -

I just noticed something in the chain. There was not a 2.1 version of the plugin. The dependency poms were not correct. One of the reasons we have a staging repo now.
All the versions after 2.0.1 used findbugs 1.3.9 instead of 1.3.8

Show
Garvin LeClaire added a comment - I just noticed something in the chain. There was not a 2.1 version of the plugin. The dependency poms were not correct. One of the reasons we have a staging repo now. All the versions after 2.0.1 used findbugs 1.3.9 instead of 1.3.8
Hide
Christoph Kutzinski added a comment -

Well I've definitely a 2.1 in my local repository and I can also see it on maven central. Based on the publication date, it's maybe just a renamed 2.0.1

Anyway, the performance characteristics of 2.0.1 seem to be identical to 2.1

Show
Christoph Kutzinski added a comment - Well I've definitely a 2.1 in my local repository and I can also see it on maven central. Based on the publication date, it's maybe just a renamed 2.0.1 Anyway, the performance characteristics of 2.0.1 seem to be identical to 2.1
Hide
Christoph Kutzinski added a comment -

Sorry, to keep bothering you with this topic, but I'm still trying to understand the reason for the longer times (and hence why it 'Won't Fix')
Is the new version now really doing more (e.g. checking more bug patterns)
OR
is it doing the same and just (for some reason) needs more time to do it?

Ergo, in the 2nd case there wouldn't be any motivation for me to ever upgrade to findbugs-plugin 2.3.x

Show
Christoph Kutzinski added a comment - Sorry, to keep bothering you with this topic, but I'm still trying to understand the reason for the longer times (and hence why it 'Won't Fix') Is the new version now really doing more (e.g. checking more bug patterns) OR is it doing the same and just (for some reason) needs more time to do it? Ergo, in the 2nd case there wouldn't be any motivation for me to ever upgrade to findbugs-plugin 2.3.x

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: