Re: Many concurrent users of site using XPathDocument and XslTransform objects efficiently?
From: Michael Pearson (michaelp_extrajunktoremove_at_televox.com)
Date: 03/25/04
- Next message: Bob: "Re: Why MC++ is faster then C# ?"
- Previous message: Novice: "Many concurrent users of site using XPathDocument and XslTransform objects efficiently?"
- In reply to: Novice: "Many concurrent users of site using XPathDocument and XslTransform objects efficiently?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 25 Mar 2004 10:49:11 -0600
Have you thought about Caching?
Output caching might be very helpful, depending on how often those XML docs
change.
Think about how fast your site if you only had to go through your XSLT
transform once every 30 minutes or so.
Michael
"Novice" <6tc1ATqlinkDOTqueensuDOTca> wrote in message
news:2B79A2E1-C345-4E6F-94AF-F6818AF77EF4@microsoft.com...
> Hi all, I've just finished writing a website using aspx pages (with VB
behind) and it seems to be working adequately, except that I anticipate that
it will become fairly slow as the number of concurrent users (up to possible
1000) start using it - no surprise. However, now my job is to try to ensure
the efficiency of the code before it is deployed.
>
> The foundation of the entire site is the use of XMl files that are being
formatted using XSL.
>
> Likely the greatest cost (in terms of processing) is reading the XML files
into memory (the XSL files are VERY small compared to the XML files so I'm
not as worried about reading them in). Some of the XML files are a few
megabytes large and if they are getting loaded by hundreds of different
users, that is likely going to not only use a significant amount of memory,
but it is also going to have the code loading the same file multiple times.
>
> I was thinking about using the Singleton pattern to encapsulate a
XPathDocument, but noticed this on the Microsoft site concerning the
XPathDocument:
> "Any public static (Shared in Visual Basic) members of this type are
thread safe. Any instance members are not guaranteed to be thread safe."
>
> Now I suppose that I could wrap the entire class in a class that extends
XPathDocument and ensure the synchronization of each of the instance
functions, but then the bottleneck would be accessing the methods of the
XPathDocument object.
>
> Does anyone have any suggestions on how to make this site more efficient?
Are there commonly used design patterns when using the objects of type:
> XPathDocument
> XslTransform
>
> Specifically when using XPathDocument's:
> constructor with a String parameter
> CreateNavigator Function
>
> AND specifically when using XslTransform's:
> - default constructor
> - Load Function with String parameter
> - One of the following forms of the Transform Sub:
> - Overloads Public Sub Transform(IXPathNavigable, XsltArgumentList,
Stream, XmlResolver)
> - Overloads Public Sub Transform(IXPathNavigable, XsltArgumentList,
TextWriter, XmlResolver)
> - Overloads Public Sub Transform(IXPathNavigable, XsltArgumentList,
XmlWriter, XmlResolver)
> - There are 3 additional overloads, only difference is IXPathNavigable
is XPathNavigable
>
> The above procedures belonging to each of the two classes are the majority
of the functionality that my site is providing (the workhorse of the site if
you will). There are some other bits of functionality that I've provided,
but of much less consequence.
>
> Thanks,
> Novice
>
> PS Is any one of the three Transform Sub's any more efficient than any of
the others? I've experimented with all three and noticed no functional
difference - i.e.:
>
> 1.
> Dim xmlWriter As XmlTextWriter = New XmlTextWriter(Response.OutputStream,
System.Text.Encoding.UTF8)
> xslTransform.Transform(doc, arguments, xmlWriter, Nothing)
>
> 2.
> Dim writer As System.IO.StreamWriter = New
StreamWriter(Response.OutputStream)
> xslTransform.Transform(doc, arguments, writer, Nothing)
>
> 3.
> xslTransform.Transform(doc, arguments, Response.OutputStream, Nothing)
>
- Next message: Bob: "Re: Why MC++ is faster then C# ?"
- Previous message: Novice: "Many concurrent users of site using XPathDocument and XslTransform objects efficiently?"
- In reply to: Novice: "Many concurrent users of site using XPathDocument and XslTransform objects efficiently?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|