[
https://issues.apache.org/jira/browse/UIMA-6211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17074458#comment-17074458
]
Richard Eckart de Castilho commented on UIMA-6211:
--------------------------------------------------
The timings obtained above were take in the "Sampler" mode of VisualVM. I
checked this again, this time with the "Profiler" mode. With the profiler mode,
I can see that there are way more invocations in my particular context.
So this is basically down to a non-issue.
But while we are at it... there may still be room for small improvements here.
The org.apache.uima.cas.impl.TypeSystemImpl.ll_getTypeClass(int) internally
uses an if-return-cascade with primitive types being checked first, then the
string type, then arrays and finally falling back to FS. The if clause for the
string type includes a call to {{ll_subsumes}}:
!Screenshot 2020-04-03 at 12.16.12.png!
Since the subsumes call is slower than the other checks, it might be possible
to defer it until after the array types have been checked?
Maybe using a switch-case statement with a fall-through to cover the
string-with-subtypes case could also help a little.
> Type.isPrimitive() seems really slow
> ------------------------------------
>
> Key: UIMA-6211
> URL: https://issues.apache.org/jira/browse/UIMA-6211
> Project: UIMA
> Issue Type: Bug
> Components: UIMA
> Affects Versions: 2.10.4SDK
> Reporter: Richard Eckart de Castilho
> Priority: Major
> Attachments: Screenshot 2020-04-02 at 11.34.01.png, Screenshot
> 2020-04-03 at 12.16.12.png
>
>
> It appears as if the {{Type.isPrimitive()}} method would be very slow. Cf.
> the number of hits and the time taken in the attached screenshot.
> !Screenshot 2020-04-02 at 11.34.01.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)