[
https://issues.apache.org/jira/browse/UIMA-6200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Eckart de Castilho updated UIMA-6200:
---------------------------------------------
Attachment: Screenshot 2020-03-15 at 18.52.48.png
Description:
Creating an aggregate engine is slow because every time a default fixed flow
descriptor is loaded from the classpath as XML and parsed.
*FixedFlowController*
{code}
public static FlowControllerDescription getDescription() {
URL descUrl = FixedFlowController.class
.getResource("/org/apache/uima/flow/FixedFlowController.xml");
FlowControllerDescription desc;
try {
desc = (FlowControllerDescription) UIMAFramework.getXMLParser().parse(
new XMLInputSource(descUrl));
} catch (InvalidXMLException e) {
throw new UIMARuntimeException(e);
} catch (IOException e) {
throw new UIMARuntimeException(e);
}
return desc;
}
{code}
IMHO, this should be loaded once and then cached permanently - or be
constructed completely programmatically (also once!) and never loaded at all.
!Screenshot 2020-03-15 at 18.52.48.png!
was:
Creating an aggregate engine is slow because every time a default fixed flow
descriptor is loaded from the classpath as XML and parsed.
*FixedFlowController*
{code}
public static FlowControllerDescription getDescription() {
URL descUrl = FixedFlowController.class
.getResource("/org/apache/uima/flow/FixedFlowController.xml");
FlowControllerDescription desc;
try {
desc = (FlowControllerDescription) UIMAFramework.getXMLParser().parse(
new XMLInputSource(descUrl));
} catch (InvalidXMLException e) {
throw new UIMARuntimeException(e);
} catch (IOException e) {
throw new UIMARuntimeException(e);
}
return desc;
}
{code}
IMHO, this should be loaded once and then cached permanently - or be
constructed completely programmatically (also once!) and never loaded at all.
!Screenshot 2020-03-15 at 18.50.30.png!
> Constructing aggregate engines is slow
> --------------------------------------
>
> Key: UIMA-6200
> URL: https://issues.apache.org/jira/browse/UIMA-6200
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Reporter: Richard Eckart de Castilho
> Priority: Minor
> Fix For: 2.10.5SDK
>
> Attachments: Screenshot 2020-03-15 at 18.52.48.png
>
>
> Creating an aggregate engine is slow because every time a default fixed flow
> descriptor is loaded from the classpath as XML and parsed.
> *FixedFlowController*
> {code}
> public static FlowControllerDescription getDescription() {
> URL descUrl = FixedFlowController.class
> .getResource("/org/apache/uima/flow/FixedFlowController.xml");
> FlowControllerDescription desc;
> try {
> desc = (FlowControllerDescription) UIMAFramework.getXMLParser().parse(
> new XMLInputSource(descUrl));
> } catch (InvalidXMLException e) {
> throw new UIMARuntimeException(e);
> } catch (IOException e) {
> throw new UIMARuntimeException(e);
> }
> return desc;
> }
> {code}
> IMHO, this should be loaded once and then cached permanently - or be
> constructed completely programmatically (also once!) and never loaded at all.
> !Screenshot 2020-03-15 at 18.52.48.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)