sandygao 2003/04/02 14:43:30 Modified: java/src/org/apache/xerces/dom DeferredDocumentImpl.java Log: The first step towards improving the performance of the deferred DOM. Instead of setting the value of each entry in the array, use the system array copy method. Revision Changes Path 1.52 +8 -5 xml-xerces/java/src/org/apache/xerces/dom/DeferredDocumentImpl.java Index: DeferredDocumentImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DeferredDocumentImpl.java,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- DeferredDocumentImpl.java 17 Jan 2003 22:40:54 -0000 1.51 +++ DeferredDocumentImpl.java 2 Apr 2003 22:43:30 -0000 1.52 @@ -1935,13 +1935,16 @@ // // Private methods // - + private static final int[] INIT_ARRAY = new int[CHUNK_SIZE + 1]; + static { + for (int i = 0; i < CHUNK_SIZE; i++) { + INIT_ARRAY[i] = -1; + } + } /** Creates the specified chunk in the given array of chunks. */ private final void createChunk(int data[][], int chunk) { data[chunk] = new int[CHUNK_SIZE + 1]; - for (int i = 0; i < CHUNK_SIZE; i++) { - data[chunk][i] = -1; - } + System.arraycopy(INIT_ARRAY, 0, data[chunk], 0, CHUNK_SIZE); } class RefCount {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]