Commit f6bc7c24 authored by Daniel Veillard's avatar Daniel Veillard

add a Timingtests target to check bad behaviour from the streaming engine

* Makefile.am: add a Timingtests target to check bad behaviour
  from the streaming engine
* dbgen.pl dbgenattr.pl: perl script to generate big instances
* xmlreader.c: fix a bad behaviour on large buffer inputs
Daniel
parent ccc4d2b6
Thu Sep 18 00:31:02 CEST 2003 Daniel Veillard <daniel@veillard.com>
* Makefile.am: add a Timingtests target to check bad behaviour
from the streaming engine
* dbgen.pl dbgenattr.pl: perl script to generate big instances
* xmlreader.c: fix a bad behaviour on large buffer inputs
Wed Sep 17 23:25:47 CEST 2003 Daniel Veillard <daniel@veillard.com>
* dict.c xmlreader.c: two small improvements
......
......@@ -120,7 +120,7 @@ check-local: tests
testall : tests SVGtests SAXtests
tests: XMLtests XMLenttests NStests Readertests SAXtests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests C14Ntests Scripttests Catatests @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@
tests: XMLtests XMLenttests NStests Readertests SAXtests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests C14Ntests Scripttests Catatests @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests
@(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; $(MAKE) tests ; fi)
valgrind:
......@@ -699,6 +699,24 @@ Automatatests: testAutomata$(EXEEXT)
rm result.$$name ; \
fi ; fi ; done)
$(srcdir)/dba100000.xml: dbgenattr.pl
@echo "## generating dba100000.xml"
@(dbgenattr.pl 100000 > $(srcdir)/dba100000.xml)
Timingtests: $(srcdir)/dba100000.xml
@echo "##"
@echo "## Timing tests to try to detect performance"
@echo "## as well a memory usage breakage when streaming"
@echo "## first when using the file interface"
@echo "## then when using the memory interface"
@echo "##"
-@(xmllint --stream --timing $(srcdir)/dba100000.xml; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
exit 0)
-@(xmllint --stream --timing --memory $(srcdir)/dba100000.xml; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
exit 0)
C14Ntests : testC14N$(EXEEXT)
@echo "##"
@echo "## C14N and XPath regression tests"
......@@ -869,7 +887,9 @@ EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
$(man_MANS) libxml-2.0.pc.in \
trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
triop.h triodef.h libxml.h \
testThreadsWin32.c genUnicode.py TODO_SCHEMAS
testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
dbgen.pl dbgenattr.pl
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxml-2.0.pc
......
#!/usr/bin/perl
$size = shift;
if ($size eq "")
{
die "usage: dbgen.pl [size]\n";
}
@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
"George", "Hank", "Inki", "James");
@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
"Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
print "<?xml version=\"1.0\"?>\n";
print "\n";
print "<table>\n";
for ($i=0; $i<$size; $i++)
{
$first = $firstnames [$i % 10];
$last = $lastnames [($i / 10) % 10];
$state = $states [($i / 100) % 50];
$zip = 22000 + $i / 5000;
printf " <row>\n";
printf " <id>%04d</id>\n", $i;
printf " <firstname>$first</firstname>\n", $i;
printf " <lastname>$last</lastname>\n", $i;
printf " <street>%d Any St.</street>\n", ($i % 100) + 1;
printf " <city>Anytown</city>\n";
printf " <state>$state</state>\n";
printf " <zip>%d</zip>\n", $zip;
printf " </row>\n";
}
print "</table>\n";
#!/usr/bin/perl
$size = shift;
if ($size eq "")
{
die "usage: dbgen.pl [size]\n";
}
@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
"George", "Hank", "Inki", "James");
@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
"Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
print "<?xml version=\"1.0\"?>\n";
print "\n";
print "<table>\n";
for ($i=0; $i<$size; $i++)
{
$first = $firstnames [$i % 10];
$last = $lastnames [($i / 10) % 10];
$state = $states [($i / 100) % 50];
$zip = 22000 + $i / 5000;
printf " <row\n";
printf " id='%04d'\n", $i;
printf " firstname='$first'\n", $i;
printf " lastname='$last'\n", $i;
printf " street='%d Any St.'\n", ($i % 100) + 1;
printf " city='Anytown'\n";
printf " state='$state'\n";
printf " zip='%d'/>\n", $zip;
}
print "</table>\n";
......@@ -803,7 +803,8 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
* Discard the consumed input when needed and possible
*/
if (reader->mode == XML_TEXTREADER_MODE_INTERACTIVE) {
if (reader->cur >= 4096) {
if ((reader->cur >= 4096) &&
(inbuf->use - reader->cur <= CHUNK_SIZE)) {
val = xmlBufferShrink(inbuf, reader->cur);
if (val >= 0) {
reader->cur -= val;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment