Details
-
Type: Improvement
-
Status: Closed (View Workflow)
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 1.6
-
Fix Version/s: 1.6.1
-
Component/s: o.c.jsword.book.filter.osis
-
Labels:None
-
Environment:
Android
Description
Only JDOM version 1.1.1 is compatible with Android so in my copy I upgraded JSword's JDOM 1.0 to 1.1.1 which caused no issues because JDOM is so stable and well tested.
JDOM 1.1.1 also provides a new SAXBuilder flag for faster parsing (see second paragraph of jdom.org) which I think is SAXBuilder.setFastReconfigure() which has this description:
"Specifies whether this builder will do fast reconfiguration of the underlying SAX parser when reuseParser is true. This improves performance in cases where SAXBuilders are reused and lots of small documents are frequently parsed. This avoids attempting to set features on the SAX parser each time build() is called which result in SaxNotRecognizedExceptions."
I added this flag to OSISFilter and OSIS parsing was improved by about 20%. My tests monitored the time from the first OSISFilter.parse() to the last parse() so it is not a 20% improvement on the whole time it takes to show a chapter.
Here is And Bible's code from OSISFilter with the one line change:
private Element parse(String plain) throws JDOMException, IOException