From: Sasa M. <sa...@us...> - 2004-09-01 08:00:03
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23147/org/jrobin/core Modified Files: RrdDbPool.java Log Message: Minor speed improvements (excessive debug info removed) Index: RrdDbPool.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdDbPool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** RrdDbPool.java 31 Aug 2004 15:08:47 -0000 1.12 --- RrdDbPool.java 1 Sep 2004 07:59:54 -0000 1.13 *************** *** 173,177 **** reportUsage(canonicalPath, rrdEntry); poolHitsCount++; ! debug("CACHED: " + rrdEntry.dump()); return rrdEntry.getRrdDb(); } --- 173,177 ---- reportUsage(canonicalPath, rrdEntry); poolHitsCount++; ! // debug("CACHED: " + rrdEntry.dump()); return rrdEntry.getRrdDb(); } *************** *** 181,185 **** rrdEntry = new RrdEntry(rrdDb); addRrdEntry(canonicalPath, rrdEntry); ! debug("ADDED: " + rrdEntry.dump()); return rrdDb; } --- 181,185 ---- rrdEntry = new RrdEntry(rrdDb); addRrdEntry(canonicalPath, rrdEntry); ! // debug("ADDED: " + rrdEntry.dump()); return rrdDb; } *************** *** 238,242 **** RrdEntry newRrdEntry = new RrdEntry(rrdDb); addRrdEntry(canonicalPath, newRrdEntry); ! debug("ADDED: " + newRrdEntry.dump()); return rrdDb; } --- 238,242 ---- RrdEntry newRrdEntry = new RrdEntry(rrdDb); addRrdEntry(canonicalPath, newRrdEntry); ! // debug("ADDED: " + newRrdEntry.dump()); return rrdDb; } *************** *** 302,306 **** } else { // open but released... safe to close it ! debug("WILL BE RECREATED: " + rrdEntry.dump()); removeRrdEntry(canonicalPath, rrdEntry); } --- 302,306 ---- } else { // open but released... safe to close it ! // debug("WILL BE RECREATED: " + rrdEntry.dump()); removeRrdEntry(canonicalPath, rrdEntry); } *************** *** 311,315 **** rrdMap.remove(canonicalPath); rrdIdleMap.remove(canonicalPath); ! debug("REMOVED: " + rrdEntry.dump()); } --- 311,315 ---- rrdMap.remove(canonicalPath); rrdIdleMap.remove(canonicalPath); ! // debug("REMOVED: " + rrdEntry.dump()); } *************** *** 336,340 **** RrdEntry rrdEntry = (RrdEntry) rrdMap.get(canonicalPath); reportRelease(canonicalPath, rrdEntry); ! debug("RELEASED: " + rrdEntry.dump()); } else { throw new RrdException("RRD file " + rrdDb.getPath() + " not in the pool"); --- 336,340 ---- RrdEntry rrdEntry = (RrdEntry) rrdMap.get(canonicalPath); reportRelease(canonicalPath, rrdEntry); ! // debug("RELEASED: " + rrdEntry.dump()); } else { throw new RrdException("RRD file " + rrdDb.getPath() + " not in the pool"); *************** *** 352,356 **** */ public void run() { ! debug("GC: started"); for (; ;) { synchronized (this) { --- 352,356 ---- */ public void run() { ! // debug("GC: started"); for (; ;) { synchronized (this) { *************** *** 359,363 **** String canonicalPath = (String) rrdIdleMap.keySet().iterator().next(); RrdEntry rrdEntry = (RrdEntry) rrdIdleMap.get(canonicalPath); ! debug("GC: closing " + rrdEntry.dump()); removeRrdEntry(canonicalPath, rrdEntry); } catch (IOException e) { --- 359,363 ---- String canonicalPath = (String) rrdIdleMap.keySet().iterator().next(); RrdEntry rrdEntry = (RrdEntry) rrdIdleMap.get(canonicalPath); ! // debug("GC: closing " + rrdEntry.dump()); removeRrdEntry(canonicalPath, rrdEntry); } catch (IOException e) { *************** *** 368,376 **** else { try { ! debug("GC: waiting: " + rrdMap.size() + " open, " + rrdIdleMap.size() + ! " released, " + "capacity = " + capacity + ", " + "hits = " + ! poolHitsCount + ", " + "requests = " + poolRequestsCount); wait(); ! debug("GC: running"); } catch (InterruptedException e) { e.printStackTrace(); --- 368,374 ---- else { try { ! // debug("GC: waiting"); wait(); ! // debug("GC: running"); } catch (InterruptedException e) { e.printStackTrace(); *************** *** 378,382 **** } } - // Thread.yield(); } } --- 376,379 ---- *************** *** 399,403 **** rrdMap.clear(); rrdIdleMap.clear(); ! debug("Nothing left in the pool"); } --- 396,400 ---- rrdMap.clear(); rrdIdleMap.clear(); ! // debug("Pool cleared"); } *************** *** 406,410 **** } ! private static void debug(String msg) { if (DEBUG) { System.out.println("POOL: " + msg); --- 403,407 ---- } ! static void debug(String msg) { if (DEBUG) { System.out.println("POOL: " + msg); *************** *** 483,487 **** public synchronized void setCapacity(int capacity) { this.capacity = capacity; ! debug("Capacity set to: " + capacity); } --- 480,484 ---- public synchronized void setCapacity(int capacity) { this.capacity = capacity; ! // debug("Capacity set to: " + capacity); } *************** *** 529,533 **** String dump() throws IOException { ! String canonicalPath = rrdDb.getCanonicalPath(); return canonicalPath + " [" + usageCount + "]"; } --- 526,530 ---- String dump() throws IOException { ! String canonicalPath = getCanonicalPath(rrdDb.getPath()); return canonicalPath + " [" + usageCount + "]"; } |