Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 66978 invoked from network); 15 Dec 2006 14:50:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Dec 2006 14:50:44 -0000 Received: (qmail 84080 invoked by uid 500); 15 Dec 2006 14:50:50 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 84052 invoked by uid 500); 15 Dec 2006 14:50:50 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 84043 invoked by uid 99); 15 Dec 2006 14:50:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Dec 2006 06:50:50 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Dec 2006 06:50:42 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 97DF071413D for ; Fri, 15 Dec 2006 06:50:21 -0800 (PST) Message-ID: <29039503.1166194221612.JavaMail.jira@brutus> Date: Fri, 15 Dec 2006 06:50:21 -0800 (PST) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-2150) Reduce use of synchronized collections in GenericLanguageConnectionContext In-Reply-To: <22068367.1165331363990.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DERBY-2150?page=all ] Knut Anders Hatlen updated DERBY-2150: -------------------------------------- Attachment: derby-2150-1a.diff I've had a partial patch for this issue in my sandbox for a while. Attaching it here so that it won't be lost. The patch replaces four Vectors with ArrayLists. More investegation is needed in order to find out whether these changes are safe. FWIW, derbyall and the JUnit tests ran cleanly on Solaris 10 and Sun Java SE 5.0 with this patch. removeActivation() contains some code which is not as easily expressed with ArrayList as with Vector, since ArrayList doesn't have an equivalent to Vector.capacity(). int capacity = acts.capacity(); if (capacity > 20 && (capacity > 2 * acts.size())) { acts.trimToSize(); } This optimization might save space in some cases, but it doesn't seem like a very important optimization (I believe it is even less important now that DERBY-418 is fixed), so I just commented it out in the patch for now. If one really wants this optimization, it should be fairly easy to implement it by keeping track of the largest observed value of acts.size() in addActivation() and use that value instead of acts.capacity() in removeActivation(). But first we need to find out whether it is safe to remove the synchronization... > Reduce use of synchronized collections in GenericLanguageConnectionContext > -------------------------------------------------------------------------- > > Key: DERBY-2150 > URL: http://issues.apache.org/jira/browse/DERBY-2150 > Project: Derby > Issue Type: Improvement > Components: SQL, Performance > Affects Versions: 10.3.0.0 > Reporter: Knut Anders Hatlen > Priority: Minor > Attachments: derby-2150-1a.diff > > > In org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext, it is probably safe to replace some of the synchronized collections with unsynchronized ones. This should be investigated, and the unnecessary synchronization should be removed. See discussion here: http://www.nabble.com/Use-of-synchronized-containers-in-engine-code-tf2754469.html -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira