Return-Path: Delivered-To: apmail-incubator-uima-user-archive@locus.apache.org Received: (qmail 29925 invoked from network); 11 Jul 2007 18:32:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jul 2007 18:32:18 -0000 Received: (qmail 76965 invoked by uid 500); 11 Jul 2007 18:32:20 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 76949 invoked by uid 500); 11 Jul 2007 18:32:20 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 76935 invoked by uid 99); 11 Jul 2007 18:32:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jul 2007 11:32:20 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of twgoetz@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 11 Jul 2007 11:32:17 -0700 Received: (qmail invoked by alias); 11 Jul 2007 18:31:55 -0000 Received: from p5B20248F.dip0.t-ipconnect.de (EHLO [192.168.0.104]) [91.32.36.143] by mail.gmx.net (mp052) with SMTP; 11 Jul 2007 20:31:55 +0200 X-Authenticated: #25330878 X-Provags-ID: V01U2FsdGVkX1+whlIc9hiwOpW84ipFx855xUcn6DTPwVaof/IJrl LwxyWgkpJ8Pg7X Message-ID: <4695221C.3050500@gmx.de> Date: Wed, 11 Jul 2007 20:31:56 +0200 From: Thilo Goetz User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: uima-user@incubator.apache.org Subject: Re: Why XmiCasSerializer is slow References: <071120071739.18013.469515D40009E2210000465D2206998499C0C0CFCD099D0A0D03040108@comcast.net> <46951D80.9010307@schor.com> In-Reply-To: <46951D80.9010307@schor.com> X-Enigmail-Version: 0.95.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Marshall Schor wrote: > The code for ll_isArrayType(int) is: > > public boolean ll_isArrayType(int typeCode) { > if (!ll_isValidTypeCode(typeCode)) { > return false; > } > return this.arrayCodeToTypeMap.containsKey(typeCode); > } > > It seems to me the check for valid type code could be omitted - because > the arrayCodeToTypeMap.containsKey would return false if the code was > invalid. > Thilo - do you agree? Yes, it looks that way. The if-clause seems redundant. I wonder if there used to be a data structure in there that couldn't handle negative values. > > Note that changing this might not make the problem go away - there are > potentially other places where synch. is happening. > > -Marshall > > greg@holmberg.name wrote: >>> Also perhaps we can drastically reduce the number of times the >>> serializer calls this method. Among other places, it looks like it is >>> called by Type.isArray, which is in turn called by >>> TypeSystem.subsumes. I'd have to run a test with the XmiCasSerializer >>> to see what the real call stack looks like. >>> >> >> Here's the call stack of the most expensive path, in case it helps: >> >> >> XmiCasSerializer$XmiCasDocSerializer. >> CASImpl.ll_getTypeClass(int) >> TypeSystemImpl.subsumes(int, int) >> TypeSystemImpl.ll_subsumes(int, int) >> TypeSystemImpl.ll_isArrayType(int) >> TypeSystemImpl.ll_isValidTypeCode(int) >> SymbolTable.getSymbol(int) >> Vector.get(int) >> >> >> Greg Holmberg >> >> >>