uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall Schor <...@schor.com>
Subject A possible core speedup
Date Wed, 01 Oct 2008 15:23:04 GMT
I'm not sure this would speed anything up - but just in case:

While doing some profiling, it appears that some time is spent (during
deserializing) in CasImpl's ll_getTypeClass.  This code is a big switch
statement written as a series of "if" statements, testing the current
typeSystemImpl instance's set of values for primitive type codes.

Switch can't be used here because the "case" values must be constants. 
I think all the built-in type codes are constant - but the
implementation seems to be allowing them to change (they're referenced
from the TypeSystemImpl instance, as non-final values). 

Using constants would probably speed up this function quite a bit.  Any
reasons anyone sees we couldn't/shouldn't change this to use constants?


View raw message