public void configureForSpeed ( ) { // StAX (1.0): doCoalesceText ( false ) ; // StAX2: doPreserveLocation ( false ) ; doReportPrologWhitespace ( false ) ; //doInternNames(true); // this is a NOP doInternNsURIs ( true ) ; doXmlIdUniqChecks ( false ) ; // Woodstox-specific: doCacheDTDs ( true ) ; doParseLazily ( true ) ; /* If we let Reader decide sizes of text segments, it should be * able to optimize it better, thus low min value. This value * is only used in cases where text is at buffer boundary, or * where entity prevents using consequtive chars from input buffer: */ setShortestReportedTextSegment ( 16 ) ; setInputBufferLength ( 8000 ) ; // 16k input buffer }
Method to call to make the Reader created be as fast as possible reading documents especially for long - running processes where caching is likely to help .