Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 92893 invoked from network); 28 Nov 2006 19:29:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 19:29:43 -0000 Received: (qmail 87676 invoked by uid 500); 28 Nov 2006 19:29:52 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 87649 invoked by uid 500); 28 Nov 2006 19:29:52 -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 87640 invoked by uid 99); 28 Nov 2006 19:29:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 11:29:52 -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; Tue, 28 Nov 2006 11:29:42 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 619D47142F9 for ; Tue, 28 Nov 2006 11:29:22 -0800 (PST) Message-ID: <1393048.1164742162397.JavaMail.jira@brutus> Date: Tue, 28 Nov 2006 11:29:22 -0800 (PST) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-2122) Optimize ContainerLock.isCompatible() In-Reply-To: <17558296.1164740064057.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-2122?page=all ] Knut Anders Hatlen updated DERBY-2122: -------------------------------------- Attachment: derby-2122-v1.diff derby-2122-v1.stat The attached patch removes the compatibility matrix from ContainerLock and instead maintains a bit mask containing the type ids of the compatible lock types. Compatibility checking between two lock types could therefore be performed by a bitwise and of the the bit mask and the type id. Similar changes were made to RowLock to keep the two classes consistent. I have run some experiments with this patch and the test client from DERBY-1961 (single-record selects with 16 concurrent clients on embedded Derby). Experiment 1: 40 runs (20 with clean trunk, 20 with patch for ContainerLock only) consisting of 30 seconds warm-up and 60 seconds counting transactions. Result: Average throughput increased by 1.2% with the patch. Experiment 2: Same as above, but counting transactions for 100 seconds instead of 60 seconds. Result: Average throughput increased by 1.7% with the patch. Experiment 3: Same as above, but with the full patch (that is, both ContainerLock and RowLock changed). Result: Average throughput increased by 1.9% with the patch. I don't have a fancy script that calculates how significant these numbers are (can do it on request, since I really need to refresh my statistics skills), but they at least give an indication that the patch has a small positive impact. Reviews would be appreciated. Thanks. > Optimize ContainerLock.isCompatible() > ------------------------------------- > > Key: DERBY-2122 > URL: http://issues.apache.org/jira/browse/DERBY-2122 > Project: Derby > Issue Type: Improvement > Components: Store, Performance > Affects Versions: 10.2.1.6 > Reporter: Knut Anders Hatlen > Assigned To: Knut Anders Hatlen > Priority: Trivial > Attachments: derby-2122-v1.diff, derby-2122-v1.stat > > > The numbers at http://wiki.apache.org/db-derby/Derby1961MethodCalls indicate that ContainerLock.isCompatible() is called many times per transaction, at least when there are multiple concurrent clients operating on the same containers. Currently, it looks into a two-dimensional array to find out whether two locks are compatible. This could be implemented more efficiently, for instance by having a bit pattern in each ContainerLock object representing which lock types it is compatible with. -- 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