Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-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 6D1B8E55E for ; Sat, 9 Feb 2013 19:27:07 +0000 (UTC) Received: (qmail 55366 invoked by uid 500); 9 Feb 2013 19:27:07 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 55328 invoked by uid 500); 9 Feb 2013 19:27:07 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 55320 invoked by uid 99); 9 Feb 2013 19:27:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Feb 2013 19:27:07 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [87.230.106.24] (HELO vwp1524.webpack.hosteurope.de) (87.230.106.24) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Feb 2013 19:26:59 +0000 Received: from essn-5d839c9b.pool.mediaways.net ([93.131.156.155] helo=florian-mac-privat.fritz.box); authenticated by vwp1524.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1U4G4K-0005Um-Vn; Sat, 09 Feb 2013 20:26:37 +0100 Message-ID: <5116A2EA.9050901@apache.org> Date: Sat, 09 Feb 2013 20:26:34 +0100 From: =?ISO-8859-1?Q?Florian_M=FCller?= User-Agent: Postbox 3.0.7 (Macintosh/20130119) MIME-Version: 1.0 To: dev@chemistry.apache.org CC: "kyle.adams@alfresco.com" , Bindu Wavell Subject: Re: Very bad performance when explicitly paging References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;fmui@apache.org;1360438019;d2025fdf; X-Virus-Checked: Checked by ClamAV on apache.org Hi Bindu, I cannot comment on the absolute numbers. There many factors that can affect the performance and you seem to have an issue in your setup. But I can explain the relative difference between your tests. By default, OpenCMIS fetches batches of 100 objects. Since your test doesn't iterate through all children, it only fetches one batch. Your second test forces OpenCMIS to fetch a batch of 1000 objects. Fetching 10 times more objects results in a 10 times longer response time. Btw. setMaxItemsPerPage() doesn't do any paging. It's a tuning option. Paging works like this: ItemIterable page = session.getObjectByPath("/My Project/Forms").getChildren(ctx).skipTo(100).getPage(100); Florian P.S.: If you want to learn about CMIS performance tuning have a look at the book "CMIS and Apache Chemistry in Action" (http://www.manning.com/mueller/). > I'm not sure if the following is an Alfresco issue or a Chemistry issue, so for now I'm reporting it to both sets of folks :) Of course it's possible that this is not an issue at all. As I said in my previous post I'm testing with CMIS Workbench 0.8 and against Alfresco Enterprise 4.2.1.8. > > In Alfresco, I used the following javascript to create 1000 empty documents in a folder: > > --- > logger.log('STARTING'); > for (var i = 1; i<= 1000; i++) > { > document.createFile('test-' + i + '.txt'); > } > logger.log('DONE'); > --- > > I'm profiling against the 3.x Web Services bindings using the Groovy Console in CMIS Workbench. > > The following script consistently runs in 1-2 seconds: > > --- > import org.apache.chemistry.opencmis.client.api.* > import groovy.time.* > > Date start = new Date(); > println start; > > OperationContext ctx = session.createOperationContext(); > println session.getObjectByPath("/My Project/Forms").getChildren(ctx).getTotalNumItems(); > > Date stop = new Date(); > println stop; > > TimeDuration td = TimeCategory.minus( stop, start ) > println td > > println "DONE"; > --- > > However the following script, where I just set the max items per page, consistently takes 15-17 seconds: > > --- > import org.apache.chemistry.opencmis.client.api.* > import groovy.time.* > > Date start = new Date(); > println start; > > OperationContext ctx = session.createOperationContext(); > // FOLLOWING LINE IS THE NEW CODE > ctx.setMaxItemsPerPage(1000); > // PREVIOUS LINE IS THE NEW CODE > println session.getObjectByPath("/My Project/Forms").getChildren(ctx).getTotalNumItems(); > > Date stop = new Date(); > println stop; > > TimeDuration td = TimeCategory.minus( stop, start ) > println td > > println "DONE"; > --- > > Hope this is useful for folks, > > > -- Bindu