Just for a thought...

How many parses do you get in a second then? And how many page faults is
there for each parse?
How much memory is 500 page faults?

You get a page fault for each page the program allocates (cache heatup). And
5000 bytes is at least 2 pages (depending on processor) without any overhead
what so ever. My guess is that it will take at least 4-5 pages in memory
during processing which is ~20k. If you get 100 parses a second, then 500
page faults is perfectly normal and unavoidable if you don't reuse allocated
memory which DOM doesn't.
One way to go is to do it yourself by using SAX and overwrite old memory,
that should take away most of the page faults.

Regards
Erik Rydgren
Mandarinen systems AB
Sweden

-----Original Message-----
From: Shlomi Afia [mailto:[EMAIL PROTECTED]]
Sent: den 20 augusti 2001 09:35
To: '[EMAIL PROTECTED]'
Subject: RE: HELP! Page faults, when running DOMParser on windows NT


Well, I'm using the NT's Performance Monitor, and I'm examining the "Page
Faults/sec" counter on the "Process" object. You can easily see the problem
on the Task Manager too, if you select the "Page Faults" and "Page Faults
Delta" Columns.
I got about 500 page faults per second(!) on this simple example code.
Although it looks like "soft" page faults (there is no disk activity
involved), it's still too high.
We are developing a product for which the performance is crucial, so we look
carefully at CPU consumption and page faults.
Lately, I tried to run this program with xerces 1.5.1, and unfortunately I
got more or less the same poor results.

Shlomi.

-----Original Message-----
From: Erik Schroeder [mailto:[EMAIL PROTECTED]]
Sent: Sun, August 19, 2001 9:02 PM
To: ''[EMAIL PROTECTED]' '
Subject: RE: HELP! Page faults, when running DOMParser on windows NT


This is an interesting query, since it doesn't seem to be a concern of many
(any other?) people.  This may seem strange, but would you care to elaborate
by explaining what your definition of a page fault is, and why you are
concerned about them?  What tool are you using to measure paging operations?



-----Original Message-----
From: Shlomi Afia
To: '[EMAIL PROTECTED]'
Sent: 8/19/01 8:47 AM
Subject: HELP! Page faults, when running DOMParser on windows NT

Hi there,
This is a second call :),
I'm running this simple test program on Windows NT 4,  using xerces
version
1.3.0 build with Visual C++:

int main(int argc, char* argv[])
{
        char buffer[5000];

        XMLPlatformUtils::Initialize();
        DOMParser* parser = new DOMParser;

        FILE* stream = fopen("D:\\Temp\\test.xml", "r");
        int bufferSize = fread(buffer, sizeof(char), 5000, stream);
        fclose(stream);

        while (true)
        {
                MemBufInputSource memBuff((XMLByte*)buffer, bufferSize,
"");
                parser->parse(memBuff);
                Sleep(10);
        }

        delete parser;
        return 0;
}

To my surprise, calling DOMParser::parse creates a lot of memory page
faults! (the test.xml file is less then 5000 bytes). What am I doing
wrong?
How can I eliminate these  horrible page faults, my DOMParser creates?

thanks,
Shlomi.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to