uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilo Goetz <twgo...@gmx.de>
Subject Re: Why XmiCasSerializer is slow
Date Wed, 11 Jul 2007 18:31:56 GMT
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.<many places>
>> 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
>>
>>
>>   


Mime
View raw message