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 487B5C4C3 for ; Wed, 2 May 2012 13:44:35 +0000 (UTC) Received: (qmail 86331 invoked by uid 500); 2 May 2012 13:44:35 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 86280 invoked by uid 500); 2 May 2012 13:44:35 -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 86273 invoked by uid 99); 2 May 2012 13:44:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2012 13:44:35 +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.214.50 as permitted sender) Received: from [209.85.214.50] (HELO mail-bk0-f50.google.com) (209.85.214.50) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2012 13:44:26 +0000 Received: by bkcjg9 with SMTP id jg9so684986bkc.37 for ; Wed, 02 May 2012 06:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=N3rbc9LzEFPIeQmZBw2MSzQebolyc0wJ6s56VOyQ9MY=; b=rfzploMMLb0Su5I1eLsbQ/gWraw7BGXtIsmaSx4pxfw+UiH6k+JAo7oSEXG8nNg2Ae BkVpRvQ2DKosxbr/F8oJ9rhpyPvDouOAGbuaDMsitlWZh8D5J+c+DDE3v7+CydugNs2y bE182nhhM2O2g8TM3cYn8iOEJrWaEFknf7UyXDzR4gdjw5hp0mheEZcumgiqLT6kt6We MWqiNsAxL4uVnuX0uzI9rvpeMDQBQ9RxYM+rAdz4WpbXRh1ok/ewNZMvqJpsO53/P7e+ c5DfFbscEHN3NWHo+qchZaZHWyHDLPIaSvDbsPNUwa1eYFaaSYjGRy72KUugeZWPndbF ApyQ== Received: by 10.204.13.78 with SMTP id b14mr2617812bka.32.1335966246628; Wed, 02 May 2012 06:44:06 -0700 (PDT) Received: from Emmanuels-MacBook-Pro.local (lon92-10-78-226-4-211.fbx.proxad.net. [78.226.4.211]) by mx.google.com with ESMTPS id z14sm3940250bky.15.2012.05.02.06.44.05 (version=SSLv3 cipher=OTHER); Wed, 02 May 2012 06:44:05 -0700 (PDT) Message-ID: <4FA13A24.80005@gmail.com> Date: Wed, 02 May 2012 15:44:04 +0200 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Inex branch merged into trunk... References: <4F9F3795.2040907@gmail.com> <4FA07525.1050506@gmail.com> <4FA10347.1090107@gmail.com> <4FA1124B.7010605@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 5/2/12 3:21 PM, Alex Karasulu a écrit : > On Wed, May 2, 2012 at 1:54 PM, Emmanuel Lécharnywrote: > >> Le 5/2/12 12:33 PM, Alex Karasulu a écrit : >> >>> On Wed, May 2, 2012 at 12:49 PM, Emmanuel Lécharny** >>> wrote: >>> >>> Le 5/2/12 9:53 AM, Alex Karasulu a écrit : >>>> On Wed, May 2, 2012 at 2:43 AM, Emmanuel Lécharny* >>>>> *** >>>>> >>>>> wrote: >>>>> >>>>> Le 5/1/12 3:05 PM, Alex Karasulu a écrit : >>>>> >>>>>> On Tue, May 1, 2012 at 4:08 AM, Emmanuel Lécharny>>>>>> * >>>>>>> *** >>>>>>> >>>>>>> >>>>>>> wrote: >>>>>>> >>>>>>> o Object scope search (lookup) : 49 880 req/s compared to 23 081 on >>>>>>> the >>>>>>> previous trunk >>>>>>> o One Level scope search (5 entries returned) : 68 715 entries >>>>>>> returned >>>>>>> per second, compared to 33 120/s >>>>>>> o Sub Level scope search (10 entries returned ) : 70 830 entries >>>>>>> returned >>>>>>> per second, compared to 18 910/s >>>>>>> >>>>>>> >>>>>>> This is great work Emmanuel. Nicely done! >>>>>>> >>>>>>> I have some even better results, as of today : >>>>>>> >>>>>> o Object scope search (lookup) : 52 712 req/s compared to 23 081 on the >>>>>> previous trunk >>>>>> o One Level scope search (5 entries returned) : 72 635 entries returned >>>>>> per second, compared to 33 120/s >>>>>> o Sub Level scope search (10 entries returned ) : 75 100 entries >>>>>> returned >>>>>> per second, compared to 18 910/s >>>>>> >>>>>> >>>>>> This is just sick man! You've more than doubled the performance. >>>>>> >>>>> Some new idea this morning : >>>> atm, we do clone the entries we fetch from the server, then we filter the >>>> Attributes and the values, modifying the cloned entries. This leads to >>>> useless create of the removed Attributes and Values. We suggested to >>>> accumulate the modifications and to apply them at the end, avoiding the >>>> cloning of AT which will not be returned. >>>> >>>> First of all, we can avoid cloning the Values. The Value implementation >>>> are immutable classes. This save around 7% of the time. >>>> >>>> But this is not all we can do : we can simply avoid the accumulation of >>>> modifications *and* avoid cloning the entry ! >>>> >>>> The idea is simple : when we get an entry in the cursor we have got back, >>>> we create a new empty entry, then we iterate over all the original >>>> entry's >>>> attributes and values, and for each one of those attributes and values, >>>> we >>>> check the filters, which will just tell if the Attribute/Value must be >>>> ditched or kept. This way, we don't do anything useless, like storing the >>>> modification or creating useless Attributes. >>>> >>>> It will work to the extent we deal with the CollectiveAttributes which >>>> must be injected somewhere, before we enter the loop (a >>>> connectiveAttribute >>>> might perfectly be removed by the ACI filter...). But we can also inject >>>> those added collective attributes into the loop of filters. >>>> >>>> I may miss something, but I do think that this solution is a clear >>>> winner, >>>> even in term of implementation... >>>> >>>> thoughts ? >>>> >>>> >>>> We talked about using a wrapper around the entry to encapsulate these >>> matters making it happen automatically behind the scenes. This does not >>> affect the surrounding code. >>> >>> How is this proposal now different? Why would you not use a wrapper? >>> >> Because the wrapper is useless in this case ! >> >> The beauty of the solution is that we either create a new entry with all >> the requested AT and values, accordingly to the filters (if the user embeds >> the server), or if this is a network request, we directly generates the >> encoded message without having to create the intermediate entry at all ! >> >> > I don't know how you'll pull that off considering that the interceptors > which cause side effects are expecting an entry to alter or from which to > read information from to do their thang. > > This is why I'm a bit confused. Maybe its a matter of description and the > language where I'm failing to understand. Probably... Just forgot to mention that the filters have to be modified : they won't take an Entry as a parameter, but an Attribute, and the accept( Attribute ) method will just return something telling if the Attribute should be removed or not. If at least one filter says 'remove this atttribute', then it will not be added to the resulting entry. For values (ie, the ACI filter), as we will proceed with some fine granilarity (ie values), we can consider that the passed Attribute will be cloned and modified internally, so we can fill the entry with the correct Attribute (or the original one) For the CollectiveAttribute attribute, the filter will require the full entry to be able to return the added attributes, but the mechanism is a bit different there. I was thinking that we could also get all the added ConnectiveAttributes, and inject them in the other filters. At this point, it's more ideas than implementation, but I definitively see how it could work well. Btw, some more perfs have been added into the server : o Object scope search (lookup) : 57 191/s compared to 23 081 on the previous trunk (148% more) o One Level scope search (5 entries returned) : 76 250 entries returned per second, compared to 33 120/s (130% more) o Sub Level scope search (10 entries returned ) : 77 200/s entries returned per second, compared to 18 910/s (308% more) The values are not any more cloned (the Value classes are immutable) -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com