Author: mgrigorov
Date: Thu Jun 16 12:52:34 2011
New Revision: 1136414

URL: http://svn.apache.org/viewvc?rev=1136414&view=rev
Log:
WICKET-3791 Improve AsynchronousDataStore

Replace ArrayBlockingQueue with LinkedBlockingQueue because the later 
grows/shrinks, thus it is better memory-wise.
The speed to iterate it should be similar for the small number of elements that 
it is expected to have.

suggested-by: pertl


Modified:
    
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousDataStore.java

Modified: 
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousDataStore.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousDataStore.java?rev=1136414&r1=1136413&r2=1136414&view=diff
==============================================================================
--- 
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousDataStore.java
 (original)
+++ 
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousDataStore.java
 Thu Jun 16 12:52:34 2011
@@ -16,10 +16,10 @@
  */
 package org.apache.wicket.pageStore;
 
-import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -90,7 +90,7 @@ public class AsynchronousDataStore imple
        {
                this.dataStore = dataStore;
                destroy = new AtomicBoolean(false);
-               entries = new ArrayBlockingQueue<Entry>(capacity);
+               entries = new LinkedBlockingQueue<Entry>(capacity);
                entryMap = new ConcurrentHashMap<String, Entry>();
 
                PageSavingRunnable savingRunnable = new 
PageSavingRunnable(dataStore, entries, entryMap,


Reply via email to