473,569 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Howto optimize XSL transformations (reuse compilations) on a web server?

Hi,

I have a web server application (C#) which I would like to speed up a
little. I would appriciate a discussion of design principles for a
specific optimization scenario described below.

My web server process every request by building a XML structure
containing both application data, data from the database (or another
system), and presentation data, describing how to present the
application data in the GUI. Then the web server transform this
XML-document to HTML with a XSL document. The XSL file actually
consists of 1 main XSL with include statements to 24 other XSL files,
so it's quite a large XSL document.

Most of the CPU time in my server is occupied by compiling the XSL
structure in every request. The compilation takes place when the Load()
method is called on an instance of the class XslCompiledTran sform.

So my question is: Is there an smart way to cache the compiled version
of the XSL document on the server so I will not have to recompile it in
every request?

A little more background info/questionmarks to think about :
- I have a custom session component accessible through Web Service
calls on another server so I don't use IIS sessions.
- The solution must work in load balanced scenarios.
- I don't want the solution to block other requests by using critical
sections, or at least I want to minimize the impact of resours locking.

Any idées are appreciated!
Peter

Jan 12 '06 #1
1 2500
pe************* *@extenda.se wrote:
My web server process every request by building a XML structure
containing both application data, data from the database (or another
system), and presentation data, describing how to present the
application data in the GUI. Then the web server transform this
XML-document to HTML with a XSL document. The XSL file actually
consists of 1 main XSL with include statements to 24 other XSL files,
so it's quite a large XSL document.

Most of the CPU time in my server is occupied by compiling the XSL
structure in every request. The compilation takes place when the Load()
method is called on an instance of the class XslCompiledTran sform.

So my question is: Is there an smart way to cache the compiled version
of the XSL document on the server so I will not have to recompile it in
every request?

A little more background info/questionmarks to think about :
- I have a custom session component accessible through Web Service
calls on another server so I don't use IIS sessions.
- The solution must work in load balanced scenarios.
- I don't want the solution to block other requests by using critical
sections, or at least I want to minimize the impact of resours locking.


Well, unfortunately XslCompiledTran sform doesn't allow to persist
compilation results yet. So the only option for you is caching and
precompilation - once loaded XslCompiledTran sform object is thread safe
for Transform() methods.

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
Jan 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1519
by: Mike | last post by:
I am trying to code vb.net to perform XML transformations by applying a style sheet to a XML doc. All of my XML and XSLT documents will be in either XML DOM Objects or string variables. I am not reading anything from Disk. Prior to .NET, I would this with the following code: ------ ******************* -------- 'Load Source cXML into DOM...
0
1784
by: Andreas Falck | last post by:
Hi, I ran the code below on two different versions, 4.0.14 and 4.0.16 respectively, both running RH 7.3 on intel. In version mysql server version 4.0.14 the SELECT privelege suffices for "optimize table", but (seemingly) the server version 4.0.16 requires INSERT as well. Is the INSERT privelege necessary for performing optimize in mysql
5
2556
by: Keith Chadwick | last post by:
I am migrating an existing ASP app that uses XSLT transformations to render against a language XML doc for localization and other items. When I moved this logic into .NET and the native xml and xsl objects I noticed a significant processor hit on the web machine. The xml file is roughly 110KB and the XSLT files, the called transformation has...
6
3229
by: Christopher | last post by:
I am currently in the process of evaluating the performance hits of moving to the .NET platform for our application. I created a sample project that loads the transforms the same XML and XSLT in COM, COM using interop and in C# and then transforms it to HTML. I also tried concatenating the XML and XSL as a string and then loading it to the DOM...
1
1918
by: George Durzi | last post by:
Folks, I'm running into some performance issues with my Xsl transformations. I've done a ton of debugging and digging around, and have come to the conclusion that the performance issues are NOT caused by slow stored procedures, or bad XSL/Ts. I came to this conclusion by doing a test transformation in client-side code instead of server side...
1
5364
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried,...
8
4168
by: Topper | last post by:
Hello. I have simple web folders structure: -ROOT - BIN WebService.dll WebService.asmx I need to use my WebService.dll not in bin folder - for example, in ROOT. How do i this? How can i do this without .config file only with some configuration
12
3380
by: Yash | last post by:
My SQL query is like: SELECT ..... FROM tblCLAIM C INNER join tblXXX .... INNER join tblYYY ....(5 more joins) WHERE C.created_date between @start_date and @end_date AND C.claimant_id=@claimant_id or @claimant_id=-1 AND (more conditions like the claimant condition) This query is in a stored proc which takes parameters @start_date,
3
1520
by: kp7796 | last post by:
Hello, I have some confusion about compilations process in embedded system. Can please explain compilations process up to loader
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.