Commit 7a826ddb authored by Lukáš Marek's avatar Lukáš Marek

Added initial shadow table sizes - perf increase

parent 5c548081
......@@ -8,6 +8,8 @@ import ch.usi.dag.dislreserver.exception.DiSLREServerFatalException;
public class ShadowClassTable {
private static final int INITIAL_TABLE_SIZE = 10000;
final static ShadowObject BOOTSTRAP_CLASSLOADER;
static ShadowClass JAVA_LANG_CLASS;
......@@ -20,8 +22,8 @@ public class ShadowClassTable {
BOOTSTRAP_CLASSLOADER = new ShadowObject(0, null);
JAVA_LANG_CLASS = null;
classLoaderMap = new ConcurrentHashMap<ShadowObject, ConcurrentHashMap<String, byte[]>>();
shadowClasses = new ConcurrentHashMap<Integer, ShadowClass>();
classLoaderMap = new ConcurrentHashMap<ShadowObject, ConcurrentHashMap<String, byte[]>>(INITIAL_TABLE_SIZE);
shadowClasses = new ConcurrentHashMap<Integer, ShadowClass>(INITIAL_TABLE_SIZE);
classLoaderMap.put(BOOTSTRAP_CLASSLOADER,
new ConcurrentHashMap<String, byte[]>());
......
......@@ -8,10 +8,11 @@ import ch.usi.dag.dislreserver.exception.DiSLREServerFatalException;
public class ShadowObjectTable {
private static final int INITIAL_TABLE_SIZE = 10000000;
private static ConcurrentHashMap<Long, ShadowObject> shadowObjects;
static {
shadowObjects = new ConcurrentHashMap<Long, ShadowObject>();
shadowObjects = new ConcurrentHashMap<Long, ShadowObject>(INITIAL_TABLE_SIZE);
}
public static void register(ShadowObject obj, boolean debug) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment