Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 394112 - XMLDataSource: performance problem, patch attached
Summary: XMLDataSource: performance problem, patch attached
Status: RESOLVED FIXED
Alias: None
Product: Data Tools
Classification: Tools
Component: Enablement:ODA (show other bugs)
Version: 1.10.1   Edit
Hardware: PC Windows 7
: P3 major with 2 votes (vote)
Target Milestone: 1.10.2   Edit
Assignee: Mingxia Wu CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 11:22 EST by vlad dev CLA
Modified: 2013-05-29 18:32 EDT (History)
5 users (show)

See Also:


Attachments
XML with a large characters block (5.88 KB, application/zip)
2012-11-12 11:22 EST, vlad dev CLA
no flags Details
Using StringBuilder instead of String (1.74 KB, patch)
2012-11-12 11:23 EST, vlad dev CLA
bpayton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vlad dev CLA 2012-11-12 11:22:04 EST
Created attachment 223462 [details]
XML with a large characters block

Implementation of the characters() method in org.eclipse.datatools.enablement.oda.xml.util.SaxParser is very inefficient when an XML file contains a large characters block (see attached XML file). Current implementation causes a lot of copy System.arrayCopy() operations. Using StringBuilder as a cached value would improve performance significantly.

To reproduce the problem:
- download attachment "largeCharactersBlock.zip" and unpack it
- create a new report
- add an XML data source backed by the attached XML file
- add an XML data set with two columns: "title" and "author"
- save the report file
- edit the dataset, go to preview tab, wait for result :-)

To fix the problem:
- apply the attached patch
Comment 1 vlad dev CLA 2012-11-12 11:23:04 EST
Created attachment 223463 [details]
Using StringBuilder instead of String
Comment 2 Philip Gillißen CLA 2013-01-15 11:04:40 EST
Seems reasonable, as the compiler may use the StringBuilder, if you concat the two String values (line 351), but for every call, the String is converted and reget.
Comment 3 Mingxia Wu CLA 2013-01-15 22:42:35 EST
Fix the issue by using the StringBuider, which will get better performance.