This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re[2]: correct use of keys?
- To: Michael Kay <xsl-list at lists dot mulberrytech dot com>
- Subject: Re[2]: [xsl] correct use of keys?
- From: Kevin Burges <xmldude at burieddreams dot com>
- Date: Thu, 13 Sep 2001 12:33:30 +0100
- Organization: burieddreams.com
- References: <000401c13b92$9f6e1420$f94f3c3e@PCUKMKA>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Michael + Thomas:
>> I have a stylesheet which, when run on a 10MB doc turns it into a 30MB
>> doc in ~600 seconds.
>> Even for such a large doc, this seems like along time given my machine
>> is a 1.33GHz Athlon, 256MB.
MK> It seems a long time to me, too. Which processor are you using? Are you
MK> getting thrashing due to shortage of memory?
I'm using the latest MSXML 4 (July?). Toward the end of the
transformation there is a small amount of swapping going on, but
certainly not what I'd call thrashing. For the majority of the time
there is virtually no drive access at all.
MK> better off doing a preprocess of the document in which elements whose name
MK> contains 'field' are given an extra attribute, field="yes", and then use
MK> this attribute in the second phase. In any case, I suspect that you are not
MK> interested in all nodes whose name contains 'field', but only in elements
MK> whose name contains 'field'. Replacing "node()" by "*" will speed things up
MK> a bit.
I tried this in a couple of stages:
Changing "node()" to "*" made no difference
Using "field = 'yes'" instead of "contains(....)" made no
difference
I also tried using specifically
"*[(name() = 'field') or (name() = 'datefield') or (name() =
'computedfield')]
This also made no difference.
In fact, when I used the "field = 'yes'" method, the Win2k task
manager said my program was using up to 175MB memory, where
previously I had not seen it above 105MB.
TP> Then I suggest that you temporarily change the stylesheet so it
TP> outputs only one node where it has to use one of the keys, and see
TP> how long it takes. This will check whether compiling the
TP> stylesheet and building the key indices is taking an inordinately
TP> long time.
I tried this, and the index was generated instantly. Presumably
because the document that is being indexed is fairly small.
TP> Another thing is whether you are testing out the transfomation in
TP> an environment where the result is displayed in a browser (like
TP> XML Cooktop or XML Spy).
No, I'm transforming programatically in VB so that's not an issue.
One thing I did notice is that if the keys are empty (I had made a
mistake), the transform only takes 60 seconds as opposed to 600.
This suggests surely that there must either be something wrong with
the way I am using the keys (so they are being ineffectual), or MSXML
has a very poor implementation of keys. Any other suggestions???
--
groovy baby,
Kevin mailto:xmldude@burieddreams.com
++++++++++++ Cool music - http://burieddreams.com/marshan
++++++ Attitude Webzine - http://burieddreams.com/attitude
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list