Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E993210FB6 for ; Tue, 12 Nov 2013 10:35:26 +0000 (UTC) Received: (qmail 75134 invoked by uid 500); 12 Nov 2013 10:35:25 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 74513 invoked by uid 500); 12 Nov 2013 10:35:19 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 74465 invoked by uid 99); 12 Nov 2013 10:35:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Nov 2013 10:35:17 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 209.85.212.179 as permitted sender) Received: from [209.85.212.179] (HELO mail-wi0-f179.google.com) (209.85.212.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Nov 2013 10:35:10 +0000 Received: by mail-wi0-f179.google.com with SMTP id fb10so3443777wid.6 for ; Tue, 12 Nov 2013 02:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=0LRBKwR80ERq3XZ7MzznYrDpJWZsJYwPHREpFAV1rMU=; b=UtTBOyUi+0dso59vjBzhJQl3JLzNCHxX0G098Ay92FHTl4ycD/2qMAEKeLcFCztO8h 2bLgdIsOoZhULQ63/bI5tyGyMjyCsLAEfAjcRSfpp+WR+QmVhOWw/Gvm2cgNld6IoUuS yoLww9A04Jr/IUjDoX7OwM2zo38TwrW+QMBlaveeZUAQhYH8mq6725VSlUT/TwachqJn c9QWbHStyWhpsaONXzgKguQLef0ZAIe0fmk47XsIKqCffshvrP+Akysm+W6tk6BQeiUE 4MzfU/ziIr3ywAZaY4rn0h3nqOluivLU4aJPv5eh58Vkbs6ptVDV8BBd4HhjtZ9EFV5H dUJg== X-Received: by 10.180.83.228 with SMTP id t4mr15742155wiy.12.1384252489663; Tue, 12 Nov 2013 02:34:49 -0800 (PST) Received: from new-host-3.home ([90.24.176.21]) by mx.google.com with ESMTPSA id dj8sm43058666wid.2.2013.11.12.02.34.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 02:34:49 -0800 (PST) Message-ID: <52820448.2060704@gmail.com> Date: Tue, 12 Nov 2013 11:34:48 +0100 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Apache Directory Developers List Subject: ApacheDS possible improvements X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi guys, now that I'm done with this damn Mavibot bug, and as I conducted some profiling sessions to see how good the server is going with Mavibot, I can provide a list of possible improvements we can make in the server. Not all of them are urgent nor needed, but it's always good to know what we can do better. here is the list : - check the findPos calls to limit the number of time we use them - don't store the UP value as a String, keep the Up byte[] (this saves 2 x String -> UTF-8 and UTF-8 -> String) - use hash of Keys, instead of plain keys, for indexes - review the way we return entries, by avoiding a clone for each entry (use a proxy entry for that). Removed Attribute are just marked as removed, we add new attributes into a special set of added Attributes. When a value is removed (Authz), we mark the value as deleted in the proxy attribute - remove the locks and use only Mavibot with revisions - MINA 3 should be used - use the messageSent event to send the next entry - don't allocate a new ByteBuffer for each entry to be sent, use a Thread Local storage to store a big direct buffer to be used during the encoding. If the ByteBuffer is not big enough, catch the exception and compute the length. We save the length computation, which is a costly operation. - use a cache for aliases (implemented) - improve the Mavibot BTree cache : we currently cache only entries, not indexes - we should not drop/add elements when we just want to update them (this is typically what we do with the RdnIndex) I can't tell how much each of those improvements can bring, but there is at least a few that are critical. For instance, storing the UP values as byte[] without converting them to String and back to byte[] when sending them will save a lot of String and byte[] creation and String -> byte[]/byte[] -> String conversions. The replace() method in index is also extremelly important (we call drop/add as many times as we have RDNs in an entry). But the most important one would be the clone removal. It eats around 25% of the search time. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com