How to bump raw SAX parsing speed from 5.8M/s to 7.4M/s in 4 lines of code:
- parser.c: small but effective parsing speed improvement
Daniel
diff --git a/ChangeLog b/ChangeLog
index e21a37b..3473744 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Apr 29 21:53:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+	* parser.c: small but effective parsing speed improvement
+
 Sun Apr 29 19:02:13 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 	* configure.in: default on the DocBook parser inclusion (for Gnome)
diff --git a/parser.c b/parser.c
index 60d0e22..007b2e7 100644
--- a/parser.c
+++ b/parser.c
@@ -2449,12 +2449,18 @@
     if ((ctxt->token == 0) && (!cdata)) {
 	in = ctxt->input->cur;
 	do {
+get_more:
 	    while (((*in >= 0x20) && (*in != '<') &&
 		    (*in != '&') && (*in <= 0x7F)) || (*in == 0x09))
 		in++;
 	    if (*in == 0xA) {
 		ctxt->input->line++;
-		continue; /* while */
+		in++;
+		while (*in == 0xA) {
+		    ctxt->input->line++;
+		    in++;
+		}
+		goto get_more;
 	    }
 	    nbchar = in - ctxt->input->cur;
 	    if (nbchar > 0) {