← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 787: Significant performance improvement in data entry loading. Reduced the number of times 'sortDataE...

 

------------------------------------------------------------
revno: 787
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-09-28 12:32:20 +0200
message:
  Significant performance improvement in data entry loading. Reduced the number of times 'sortDataElementCategoryOptionCombos' are invoked.
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java	2009-09-27 23:08:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java	2009-09-28 10:32:20 +0000
@@ -400,18 +400,21 @@
 
         for ( DataElement element : dataElements )
         {
-            Collection<DataElementCategoryOptionCombo> optionCombos = dataElementCategoryOptionComboService
-                .sortDataElementCategoryOptionCombos( element.getCategoryCombo() );
-
-            for ( DataElementCategoryOptionCombo optionCombo : optionCombos )
+            if ( !orderdCategoryOptionCombos.containsAll( element.getCategoryCombo().getOptionCombos() ) )
             {
-                if ( !orderdCategoryOptionCombos.contains( optionCombo ) )
+                Collection<DataElementCategoryOptionCombo> optionCombos = dataElementCategoryOptionComboService
+                    .sortDataElementCategoryOptionCombos( element.getCategoryCombo() );
+    
+                for ( DataElementCategoryOptionCombo optionCombo : optionCombos )
                 {
-                    orderdCategoryOptionCombos.add( optionCombo );
+                    if ( !orderdCategoryOptionCombos.contains( optionCombo ) )
+                    {
+                        orderdCategoryOptionCombos.add( optionCombo );
+                    }
                 }
             }
         }
-
+        
         // ---------------------------------------------------------------------
         // Perform ordering of categories and their options so that they could
         // be displayed as in the paper form. Note that the total number of entry