mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
I wanted to see the real speed at the SAX interface after a little too
* testSAX.c: I wanted to see the real speed at the SAX interface after a little too many Ximianer started complaining about the parser speed. added a --quiet option: paphio:~/XML -> ls -l db100000.xml -rw-rw-r-- 1 veillard www 20182040 Mar 20 10:30 db100000.xml paphio:~/XML -> time ./testSAX --quiet db100000.xml 3200006 callbacks generated real 0m1.270s Which means 16MBytes/s and 3Mcallback/s Daniel
This commit is contained in:
13
HTMLparser.c
13
HTMLparser.c
@ -147,11 +147,12 @@ PUSH_AND_POP(static, xmlChar*, name)
|
||||
|
||||
/* Inported from XML */
|
||||
|
||||
/* #define CUR (ctxt->token ? ctxt->token : (int) (*ctxt->input->cur)) */
|
||||
#define CUR ((int) (*ctxt->input->cur))
|
||||
#define CUR ((ctxt->input->cur < ctxt->input->end) ? (*ctxt->input->cur) : 0)
|
||||
#define NEXT xmlNextChar(ctxt),ctxt->nbChars++
|
||||
#define AVAIL (ctxt->input->end - ctxt->input->cur)
|
||||
|
||||
#define RAW (ctxt->token ? -1 : (*ctxt->input->cur))
|
||||
#define RAW (ctxt->token ? -1 : \
|
||||
(ctxt->input->cur < ctxt->input->end) ? (*ctxt->input->cur) : 0)
|
||||
#define NXT(val) ctxt->input->cur[(val)]
|
||||
#define CUR_PTR ctxt->input->cur
|
||||
|
||||
@ -3047,8 +3048,8 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
|
||||
else {
|
||||
/* Dump the bogus attribute string up to the next blank or
|
||||
* the end of the tag. */
|
||||
while ((IS_CHAR(CUR)) && !(IS_BLANK(CUR)) && (CUR != '>')
|
||||
&& ((CUR != '/') || (NXT(1) != '>')))
|
||||
while ((AVAIL > 0) && (IS_CHAR(CUR)) && !(IS_BLANK(CUR)) &&
|
||||
(CUR != '>') && ((CUR != '/') || (NXT(1) != '>')))
|
||||
NEXT;
|
||||
}
|
||||
|
||||
@ -4670,6 +4671,8 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
|
||||
xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
|
||||
ctxt->input->base = ctxt->input->buf->buffer->content + base;
|
||||
ctxt->input->cur = ctxt->input->base + cur;
|
||||
ctxt->input->end = ctxt->input->buf->buffer->content +
|
||||
ctxt->input->buf->buffer->use;
|
||||
#ifdef DEBUG_PUSH
|
||||
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user