On 30/05/2010 6:01 PM, Ralph Versteegen wrote:
On 31 May 2010 08:57, Mike Caron<[email protected]>  wrote:
D:\ohrrpgce>dir gentest.xml
30/05/2010  04:52 AM       237,804,960 gentest.xml

D:\ohrrpgce>xml2reload gentest.xml gentest.rld
Loaded XML document in 20857 ms
Memory usage: 301
Parsed XML document in 17049 ms
Memory usage: 573142499
Freed XML document in 35378 ms
Optimised document in 31149 ms
Memory usage: 428328275
Serialized document in 8557 ms
Tore down memory in 173 ms
Finished in 116510 ms

D:\ohrrpgce>dir gentest.rld
30/05/2010  04:31 PM       203,271,865 gentest.rld

And, here's a profile of CPU and Memory usage while doing the above:

http://taleotc.com/Reloadprofile.png

Note that on the CPU graph, Green is Usermode, while Red is Kernel mode. And
that my CPU thinks it's dual core, so you should consider the 50% mark to be
"max".

Hyperthreading?

Aka, "Make applications think the CPU can multiple things at once, when in reality it can't!". I guess "Hyperthreading" is more marketable, though. :)

Further, you should care more about the "Commit" memory, rather than th
"Physical" memory.
--
Mike

Yikes! Nearly twice as long to free as to load the XML document. Looks
like the memory allocator thrashed a lot while freeing memory, which
is odd because I would have expected xml nodes to be deleted in about
the same order they were created. Maybe libxml deletes attribute nodes
after deleting children. (Yes! I checked, and my hunch is correct!)

I assume that 3.0GB marks the total virtual memory committed on the
machine, and xml2relaod used roughly 1.5GB?

Yes, that's correct.

What does that xml file look like? It's interesting that the resulting
.reld is nearly the same size as the original! That 64MB test case
compressed to half the size.

I used this program to generate a document:

http://www.xml-benchmark.org/downloads.html

It seems to have a lot of content in the form of text nodes. Alas, I can't find the place I got the original document, since it was basically more of the same.

I suppose we could just cat the 64-meg document to itself, and do a tiny bit of editing :D

Serialisation could be a bit faster (you can always increase the
buffer size to speed it up, going from 32kb to 64kb caused about a 20%
improvement), but mostly I'm happy with that.

Honestly, that's the least of my concerns. That's always going to scale linearly with the resulting document size.

I'm more concerned, now, with the thing we haven't really been profiling: Loading these stupidly large documents again. I modified reloadtest to load it, and it ain't pretty:

Test #19: loadHugeDocument... Pass
Took 50 s
Test #20: freeHugeDocument... Pass
Took 297 ms

And, just for completion's sake, here's the 64 Meg-document's RELOAD:

Test #19: loadHugeDocument... Pass
Took 19 s
Test #20: freeHugeDocument... Pass
Took 53 ms

Ouch.

One thing I want to implement is allocating memory for multiple nodes at once. This will be tricky, though, since deleting nodes is a problem. Hmm... I will give this some thought...

--
Mike
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to