This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: speed of loading


Do you have a lot of data in your output, and does your output HTML enclose everything in a very large table? Large bounding tables normally can't be rendered incrementally, because the columns would have to be resized repeatedly as each row is loaded.
If this is what you're doing, then you might try adding the 'table-layout: fixed' CSS property to the <table> element, so that it will decide on table dimensions based on the dimensions of the cells in the first row, rather than waiting until it has the entire table's worth of data loaded. Explicit widths in your first row's td or col/colgroup elements can help with this. -- Mike Brown

Yes I do have a lot of data in the output, and the output HTML encloses them in a very large table. In fact within this table there are a few other tables embedded within, this was to format the data properly. And I will try your suggestion out thanx!



Is there a DOCTYPE declaration in the XML? Perhaps referring to a http URL? -- J.Pietschmann
No I'm not using any DOCTYPE declaration in the XML.



Joerg, I have changed the preceding::Q to preceding-sibling::Q thanx. The reason why I used 
"not(preceding::Q[position()=1]/@QuestionCollection) or @QuestionCollection!=preceding::Q[position()=1]/@QuestionCollection"
was because I wanted the first instance of all @QuestionCollection values. And this was the first way I was able to successfully get the 1st instances. I haven't really looked into another better way of doing this. I'd be happy to hear any other better and quicker way of testing for the 1st instances of a particular attribute.



Thank you all for your replies. There was something that I stumbled upon when searching for ways to increase the speed and that is XSLTemplate and XSLProcessor. There have been a few articles such as http://www.perfectxml.com/articles/xml/XSLTInMSXML.asp and http://www.xml.com.br/msdn/pdf/MSXML3_Performance.pdf that describes how it improves on XSLT performance and functionality. I have been testing on it, but have not really seen much increase in speed when loading the page. So I'm not really sure whether I have gone down the right path in trying to speed up the loading of the page, or whether I'm just not testing properly. 
If there are anymore suggestions I'm willing to try out! :)



Cheers,
Rosa


-----Original Message-----
From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de] 
Sent: Friday, 31 May 2002 7:36 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] speed of loading

Using keys is "always" very good and should descrease running times. But it 
seems you are often using preceding-axis. You have restricted it with 
"position()=1" (can be shortened to "1"), but maybe the processor isn't 
optimized for it. As far as I can see form your XML the 
preceding-sibling-axis is the better choice, at least with your 
<Q>-elements. They all have the same parent <Quenstions>. So replace 
preceding::Q with preceding-sibling::Q.

Hope this helps a bit,

Joerg

Rosa Cheng wrote:
> Thanx for you reply. In fact the XML is 22K and XSL is 32K. In the XSL I don't use '//' at all. Though I use a few for-each loops but to decrease searching time thru too many nodes, I usually use keys with extra Boolean tests, eg.
> <xsl:for-each select="key('groupNm',@GroupName)[ not(preceding::Q[position()=1]/@QuestionCollection) or @QuestionCollection!=preceding::Q[position()=1]/@QuestionCollection and @GroupName!=preceding::Q[position()=1]/@GroupName]">...</xsl:for-each>
> in fact this was only an experiment trying to restrict the nodes it processes (in an attempt to "optimise" my XSL), I used to have
> <xsl:for-each select=" key('groupNm',@GroupName)">...</xsl:for-each>
> 
> However, my XML has a lot of attributes within each node... maybe that has an impact... here is some of the XML...
> 
> <Questions QuoteId="102" Action="quoteValidation.asp" PageName="Quote" XSLstylesheet="questions.xsl" ReadOnlyXSLstylesheet="readonlyquestions.xsl" TodaysDate="24/5/2002" PreQuestionText="<div class='divNote'>some more text goes here." PreQuestionClass="bodycopy" PostQuestionText="" PostQuestionClass="bodycopy" HelpImghelp.gif" HelpButtonToolTip="Help" HelpUrlhelp.asp?id=" CSSfile="style.css" CSSbodyfile="../css/" SessionId="Test">
> 	<Q QuestionSetId="15" Visibility="Show" QuestionSetSequence="2" QuestionID="125" AnswerTag="insured_property_postcode" QuestionText="What is the postcode of the property to be insured?" ToolTip="Postcode" OnChange="f_changeMainList('property_postcode')" QuestionStyle="getquotebody" AnswerFieldStyle="getquoteanswer" AnswerFieldWidth="4" AnswerFieldMaxChars="4" SequenceNumber="1" GroupName=" Property Details" GroupStyle="getquoteheader" AnswerValue="2035" QuestionTypeName="Text" AnswerTypeName="Textbox" /> 
> 	<Q QuestionSetId="15" Visibility="Show" QuestionSetSequence="2" QuestionID="126" AnswerTag="insured_property_suburb" QuestionText="In which suburb is the property?" ToolTip="Suburb" QuestionStyle="getquotebody1" AnswerFieldStyle="getquoteanswer1" SequenceNumber="2" GroupName="Property Details" GroupStyle="getquoteheader" DefaultValue="0" VeryLongOptionList="1" AnswerValue="488" AnswerDescription="MAROUBRA" QuestionTypeName="Text" AnswerTypeName="Combobox">
> 		<QO OptionId="488" OptionDesc="MAROUBRA" OptionValue="488" /> 
> 		<QO OptionId="489" OptionDesc="MAROUBRA JUNCTION" OptionValue="489" /> 
> 		<QO OptionId="490" OptionDesc="MAROUBRA SOUTH" OptionValue="490" /> 
> 		<QO OptionId="491" OptionDesc="PAGEWOOD" OptionValue="491" /> 
>   </Q>
> </Questions>
> 
> I just read some thing about XSLTemplate and XSLProcessor, not sure whether they will help, ie by caching the XSL etc.
> 
> -----Original Message-----
> From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de] 
> Sent: Friday, 31 May 2002 4:43 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] speed of loading
> 
> Rosa Cheng wrote:
> 
>>Can anyone please tell me why it takes a while for a transformed XML to load on the IE6 browser? (the browser seems to pause and then displays the HTML) At first I transformed the XML using ASP on the server-side, and then I tried to display the XML with a reference to XSL in the XML file, the pause was still there. Even though the loading took something like 4 seconds which may not sound very slow, but I was just wondering whether this time can be shortened and how to do that.
>>
>>Thanx in advance! :)
>>
>>Rosa
> 
> 
> Hello Rosa,
> 
> without any code we can only guess. Normally MSXML is really fast, so 
> there shouldn't be no 4s-pause. So there remain two questions: How big 
> are the files (XML + XSLT)? And how optimized is the transformation? 
> Maybe you can post parts of the code. The first suggestion of optimizing 
> is always: replace '//' with more explicit XPath-expressions. Maybe it's 
> an approach for optimization in your stylesheet too.
> 
> Joerg


-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]