[rules-dev] Run findbugs on your module to find performance issues that are easy to fix
Wolfgang Laun
wolfgang.laun at gmail.com
Mon Sep 19 09:40:16 EDT 2011
Given that, in this instance, the parameter Map is currently expected to
contain no more than one (1) entry, this isn't going to boost performance...
;-)
But, generally speaking, findbugs does a great job.
-W
On 19 September 2011 15:09, Mauricio Salatino <salaboy at gmail.com> wrote:
> Nice one! I will try it now!
>
>
> On Mon, Sep 19, 2011 at 10:07 AM, Geoffrey De Smet <
> ge0ffrey.spam at gmail.com> wrote:
>
>> Hi guys,
>>
>> It's very easy to run findbugs on your module:
>>
>> cd droolsjbpm/drools-core
>> mvn site -DskipTests
>> firefox target/site/findbugs.html
>>
>> Most of the "bugs" on that webpage are ignorable, but there are a couple
>> of very interesting cases.
>> Just look for category PERFORMANCE.
>>
>>
>> For example in drools-core:
>> Method new
>> org.drools.io.impl.ResourceChangeScannerConfigurationImpl(Properties)
>> makes inefficient use of keySet iterator instead of entrySet iterator
>>
>> This code:
>> public ResourceChangeScannerConfigurationImpl(Properties properties) {
>> for( Object key : properties.keySet() ) {
>> setProperty( (String) key, (String) properties.get( key ) );
>> }
>> }
>> should be the faster alternative:
>> public ResourceChangeScannerConfigurationImpl(Properties properties) {
>> for(Map.Entry<Object, Object> entry : properties.entrySet() ) {
>> setProperty( (String) entry.getKey(), (String)
>> entry.getValue());
>> }
>> }
>>
>> --
>> With kind regards,
>> Geoffrey De Smet
>>
>>
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>
>
>
> --
> - CTO @ http://www.plugtree.com
> - MyJourney @ http://salaboy.wordpress.com
> - Co-Founder @ http://www.jugargentina.org
> - Co-Founder @ http://www.jbug.com.ar
>
> - Salatino "Salaboy" Mauricio -
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110919/6f7e4070/attachment.html
More information about the rules-dev
mailing list