Summary: | Improve Model Conversion Performance | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Automotive] Sphinx | Reporter: | Andreas Graf <graf> | ||||||
Component: | Core | Assignee: | Project Inbox <sphinx-inbox> | ||||||
Status: | CLOSED WONTFIX | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | balazs.grill | ||||||
Version: | unspecified | ||||||||
Target Milestone: | --- | ||||||||
Hardware: | PC | ||||||||
OS: | Windows NT | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Created attachment 268798 [details]
XMLString-REader
Closed stale issue before migration |
Created attachment 268797 [details] Mem-Efficient-Dom-Factory Model Conversion for large (i.e. AUTOSAR models) has a few setbacks: org.eclipse.sphinx.emf.resource.AbstractModelConverter.convertSave(XMLString, int, URI, OutputStream, String, XMLHelper, Map<?, ?>) * uses two Threads to serialize the XMLString and read it back into a DOM structure. * The JDOM factory that is being used does not do string deduplication. Suggested are the follwing changes: * Use the attached XMLStringReader implementation and * Use the attached InterningJDOMFactory The lines from PipedInputStream pipedInputStream = new PipedInputStream(); to final Document document = new SAXBuilder() .... can just be replaced with final Document document = new SAXBuilder().build(new XMLStringReader(xml)); No more threading involved. As a 2nd step, we use the new JDOM factory by replacing the line above with SAXBuilder builder = new SAXBuilder(); builder.setFactory(new InterningJDOMFactory()); final Document document = builder.build(new XMLStringReader(xml)); I think both files should go into package org.eclipse.sphinx.emf.resource