Author: nextgens
Date: 2007-02-28 19:31:59 +0000 (Wed, 28 Feb 2007)
New Revision: 11932

Modified:
   trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
   trunk/freenet/src/freenet/config/Config.java
   trunk/freenet/src/freenet/config/SubConfig.java
Log:
performance optimization : speedup the displaying of /config/ switching Config 
and SubConfig objects from HashMaps to LinkedHashMaps

Modified: trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConfigToadlet.java   2007-02-28 
19:29:34 UTC (rev 11931)
+++ trunk/freenet/src/freenet/clients/http/ConfigToadlet.java   2007-02-28 
19:31:59 UTC (rev 11932)
@@ -23,7 +23,7 @@
 public class ConfigToadlet extends Toadlet {
        // If a setting has to be more than a meg, something is seriously wrong!
        private static final int MAX_PARAM_VALUE_SIZE = 1024*1024;
-       private Config config;
+       private final Config config;
        private final NodeClientCore core;
        private final Node node;


Modified: trunk/freenet/src/freenet/config/Config.java
===================================================================
--- trunk/freenet/src/freenet/config/Config.java        2007-02-28 19:29:34 UTC 
(rev 11931)
+++ trunk/freenet/src/freenet/config/Config.java        2007-02-28 19:31:59 UTC 
(rev 11932)
@@ -3,7 +3,6 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.config;

-import java.util.HashMap;
 import java.util.LinkedHashMap;

 /** Global configuration object for a node. SubConfig's register here.
@@ -11,7 +10,7 @@
  */
 public class Config {

-       protected final HashMap configsByPrefix;
+       protected final LinkedHashMap configsByPrefix;

        public Config() {
                configsByPrefix = new LinkedHashMap();

Modified: trunk/freenet/src/freenet/config/SubConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/SubConfig.java     2007-02-28 19:29:34 UTC 
(rev 11931)
+++ trunk/freenet/src/freenet/config/SubConfig.java     2007-02-28 19:31:59 UTC 
(rev 11932)
@@ -3,7 +3,7 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.config;

-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -22,7 +22,7 @@
  */
 public class SubConfig implements Comparable {

-       private final HashMap map;
+       private final LinkedHashMap map;
        public final Config config;
        final String prefix;
        private boolean hasInitialized;
@@ -30,7 +30,7 @@
        public SubConfig(String prefix, Config config) {
                this.config = config;
                this.prefix = prefix;
-               map = new HashMap();
+               map = new LinkedHashMap();
                hasInitialized = false;
                config.register(this);
        }


Reply via email to