You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Mikael Aronsson <mi...@mail.bip.net> on 2001/10/23 15:44:15 UTC

Slow parsing.... ?

Hi !

I have created a SAX2 parser that reads in a large number of XML files, the
code is below, it works fine but for each file it gets slower, even if I use
100 copies of the same file it starts to get slow after 20-30 files, it
slows down with about 100ms for each files, so the first files is completed
in 200ms, the next in 300ms and so on.

Is there anything I need to reset or something like that between each
parse() ?

Mikael

  if(( hFind = FindFirstFile( temp, &find)) != INVALID_HANDLE_VALUE)
  {
   do
   {
    if(( find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
    {
     char tmp[ 256];

     if( *find.cFileName != '.')
     {
      sprintf( tmp, "%sCONFIGURATION\\%s\\TAGS.XML", W2A( szSysPath), W2A(
find.cFileName));
      CTagHandler handler;
      parser->setContentHandler( &handler);
      parser->setErrorHandler( &handler);
      parser->parse( tmp);
     }
    }
   } while( FindNextFile( hFind, &find));

   FindClose( hFind);
   hFind = NULL;
  }



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Slow parsing.... ?

Posted by Mikael Aronsson <mi...@mail.bip.net>.
Hi !

Yes I am using 1.5.1, I will try your solution and see if helps.

Mikael

----- Original Message -----
From: "Jason E. Stewart" <ja...@openinformatics.com>
To: <xe...@xml.apache.org>
Sent: Tuesday, October 23, 2001 4:00 PM
Subject: Re: Slow parsing.... ?


> "Mikael Aronsson" <mi...@mail.bip.net> writes:
>
> > I have created a SAX2 parser that reads in a large number of XML files,
the
> > code is below, it works fine but for each file it gets slower, even if I
use
> > 100 copies of the same file it starts to get slow after 20-30 files, it
> > slows down with about 100ms for each files, so the first files is
completed
> > in 200ms, the next in 300ms and so on.
>
> If you're using 1.5.1 or prior, you may want to test the latest
> nightly build from:
>
>   http://xml.apach.org/dist/xerces-c/nightly/
>
> there were significant memory improvements for SAX2, and these might
> be causing the problem.
>
> jas.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Slow parsing.... ?

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Mikael Aronsson" <mi...@mail.bip.net> writes:

> I have created a SAX2 parser that reads in a large number of XML files, the
> code is below, it works fine but for each file it gets slower, even if I use
> 100 copies of the same file it starts to get slow after 20-30 files, it
> slows down with about 100ms for each files, so the first files is completed
> in 200ms, the next in 300ms and so on.

If you're using 1.5.1 or prior, you may want to test the latest
nightly build from:

  http://xml.apach.org/dist/xerces-c/nightly/

there were significant memory improvements for SAX2, and these might
be causing the problem.

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org