Hi,

While tracing a ducc run, I noticed that for each work item, the method:
    /**
     * This method is called to fetch a WorkItem ID from a given CAS which
     * is required to support investment reset.
     *
     */
    public String getKey(String xmi) throws Exception {
        if ( analysisEngineMetadata == null ) {
            // WorkItem ID (key) is only supported for pieces 'n parts
            return null;
        }
        Properties props = new Properties();
        props.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE, "1000");

        TypeSystemDescription tsd = analysisEngineMetadata.getTypeSystem();
        TypePriorities tp = analysisEngineMetadata.getTypePriorities();
        FsIndexDescription[] fsid = analysisEngineMetadata.getFsIndexes();
        CAS cas;
        synchronized( CasCreationUtils.class) {
            cas = CasCreationUtils.createCas(tsd, tp, fsid, props);
        }
        // deserialize the CAS
        getUimaSerializer().deserializeCasFromXmi((String)xmi, cas);

repeatedly parses a type system descriptor, makes a type system from it, etc.,
could be costly for large type systems.  Is there any reason not to do this
just once, and reuse the "cas"?

If a new cas needs to be created, but you know the type system will
be the same, then you can parse and create the type system just once,
and pass that to the createCas, at least.

-Marshall

Reply via email to