Warning: session_start(): open(/var/lib/php/sessions/sess_vqt2f9cqhu5d0e169g29bglq9g, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// Default load factor but only 1 concurrent thread anticipated.
// This gives ~48 mill/s cache lookups
/*static final ConcurrentHashMap getMethodCache_chm
= new ConcurrentHashMap(16, 0.75f, 1);*/
// Let's try load factor 0.5.
static final ConcurrentHashMap getMethodCache_chm
= new ConcurrentHashMap(16, 0.5f, 1);
static _MethodCache getMethodCache_chm(Class c) {
_MethodCache cache = getMethodCache_chm.get(c);
if (cache == null)
getMethodCache_chm.put(c, cache = _MethodCache(c));
ret cache;
}
// This one gets ~44 mill/s cache lookups which is definitely better than the old method
svoid bench_concurrentHashMapBasedMethodCache_tweaked() {
print("Loading 1000 classes");
L classes = map classForName(takeFirst(1000, classNamesInJigsawModule("java.base")));
print("Have " + nClasses(classes) + ". Filling method caches");
time {
for (c : classes) assertNotNull(getMethodCache_chm(c));
}
print("Looking them up again.");
benchFor5(-> {
for (c : classes) assertNotNull(getMethodCache_chm(c));
});
print("Classes in method cache: " + l(getMethodCache_chm));
}