473,395 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 XslCompiledTransform.

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 2489
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 XslCompiledTransform.

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 XslCompiledTransform doesn't allow to persist
compilation results yet. So the only option for you is caching and
precompilation - once loaded XslCompiledTransform 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
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...
0
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...
5
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...
6
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...
1
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...
1
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...
8
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...
12
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...
3
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.