473,756 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to keep XSLs in Memory?

Hello,

I'm working on a project that uses over a hundred XLSs for transforming xml
documents. The project consists of several webservices (IIS) calling a few
dlls. This dlls make the business logic and are the ones that do the
transformation, so the XLSs are used by these dlls. Right now we have the
XSLs files on hard disk. This means there is lots of reading from disk. Since
reading from disk is much slower than reading from memory I am looking for a
way to keep them in memory.
Any Ideas?
Will IIS cache them? How? (Keep in mind they are used by the dlls)

I also was thinking simple work around. Using a RAM Disk, but it seems
Windows 2003 server does not support RAM Disks.

Any help?

Thanks.

Nov 12 '05 #1
15 2179
Alexis wrote:
I'm working on a project that uses over a hundred XLSs for transforming xml
documents. The project consists of several webservices (IIS) calling a few
dlls. This dlls make the business logic and are the ones that do the
transformation, so the XLSs are used by these dlls. Right now we have the
XSLs files on hard disk. This means there is lots of reading from disk. Since
reading from disk is much slower than reading from memory I am looking for a
way to keep them in memory.
Any Ideas?
Will IIS cache them? How? (Keep in mind they are used by the dlls)

I also was thinking simple work around. Using a RAM Disk, but it seems
Windows 2003 server does not support RAM Disks.


Just cache loaded XslTransform objects in cache instead of loading them
for each request. XslTransform.Tr ansform() method is thread-safe, so
once XslTransaform object is created and Load() method has been called,
it's safe to run Transform() method in many threads.

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Nov 12 '05 #2
Thanks Oleg

Can you tell me how to cache the XslTransform?
Can you send me sample code of the first call that do the cache and the
other calls that will use the cache objets.?

Thanks again
Alexis

"Oleg Tkachenko [MVP]" wrote:
Alexis wrote:
I'm working on a project that uses over a hundred XLSs for transforming xml
documents. The project consists of several webservices (IIS) calling a few
dlls. This dlls make the business logic and are the ones that do the
transformation, so the XLSs are used by these dlls. Right now we have the
XSLs files on hard disk. This means there is lots of reading from disk. Since
reading from disk is much slower than reading from memory I am looking for a
way to keep them in memory.
Any Ideas?
Will IIS cache them? How? (Keep in mind they are used by the dlls)

I also was thinking simple work around. Using a RAM Disk, but it seems
Windows 2003 server does not support RAM Disks.


Just cache loaded XslTransform objects in cache instead of loading them
for each request. XslTransform.Tr ansform() method is thread-safe, so
once XslTransaform object is created and Load() method has been called,
it's safe to run Transform() method in many threads.

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com

Nov 12 '05 #3
Alexis wrote:
Can you tell me how to cache the XslTransform?
Can you send me sample code of the first call that do the cache and the
other calls that will use the cache objets.?


If you are talking about ASP.NET, you can use standard caching methods.
Take a look at
http://msdn.microsoft.com/library/de...netchapt09.asp
for a sample.

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Nov 12 '05 #4
Thanks again.
I read the article but they are using the Application object to store the
cached objects. But as I said in the first question the transformation is
done by a Dll so I don't have access to the Application Object there.

Do you know of a method of caching without using the Application object?

More specific caching from a Dll.

You can read again the first question to understand better the problem I am
having.

Thanks again.

"Oleg Tkachenko [MVP]" wrote:
Alexis wrote:
Can you tell me how to cache the XslTransform?
Can you send me sample code of the first call that do the cache and the
other calls that will use the cache objets.?


If you are talking about ASP.NET, you can use standard caching methods.
Take a look at
http://msdn.microsoft.com/library/de...netchapt09.asp
for a sample.

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com

Nov 12 '05 #5
On Mon, 21 Mar 2005 06:59:04 -0800, Alexis wrote:
I also was thinking simple work around. Using a RAM Disk, but it seems
Windows 2003 server does not support RAM Disks.


There's no RAM disk driver *shipped* with Windows 2000 and above, but there
are many third-party RAM disk drivers available that will work. Seek (on
Google) and ye shall find.
Nov 12 '05 #6
On Tue, 22 Mar 2005 09:37:04 -0800, Alexis wrote:
But as I said in the first question the transformation is
done by a Dll so I don't have access to the Application Object there.


Your original post said the DLL will be called by a web service. So there
ultimately is an Application object available, which your DLL can access
with this:

HttpContext.Cur rent.Applicatio nInstance

Or, if you don't mind if your XSL objects are occasionally flushed from the
cache and will be reloaded, you can make more direct use of the ASP.NET
Cache this way:

HttpContext.Cur rent.Cache
Nov 12 '05 #7
Alexis wrote:
I read the article but they are using the Application object to store the
cached objects. But as I said in the first question the transformation is
done by a Dll so I don't have access to the Application Object there.

Do you know of a method of caching without using the Application object?


Quick and dirty cache is just plain Hashtable. You can make it better
using WeakReferences.
Otherwise take a look at the "Caching Application Block"
http://msdn.microsoft.com/library/de...l/caching1.asp

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Nov 12 '05 #8
Oleg Thanks again I really appreciate your help
But you are getting me to nowhere. Graet book index but little contect.
Thanks anyway for trying.

"Oleg Tkachenko [MVP]" wrote:
Alexis wrote:
I read the article but they are using the Application object to store the
cached objects. But as I said in the first question the transformation is
done by a Dll so I don't have access to the Application Object there.

Do you know of a method of caching without using the Application object?


Quick and dirty cache is just plain Hashtable. You can make it better
using WeakReferences.
Otherwise take a look at the "Caching Application Block"
http://msdn.microsoft.com/library/de...l/caching1.asp

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com

Nov 12 '05 #9
Ross Thankyou very much.

I have not have time to try it yet but it make a lot of sense. I was just
wondering how efficient it may be. The whole purpose of keeping the XSL files
or objects in memory is to improve performance. Do you know if accessing the
HttpContext from a dll will have some impact on performance?

Thanks a lot again I really appreciate your help.
"Ross Presser" wrote:
On Tue, 22 Mar 2005 09:37:04 -0800, Alexis wrote:
But as I said in the first question the transformation is
done by a Dll so I don't have access to the Application Object there.


Your original post said the DLL will be called by a web service. So there
ultimately is an Application object available, which your DLL can access
with this:

HttpContext.Cur rent.Applicatio nInstance

Or, if you don't mind if your XSL objects are occasionally flushed from the
cache and will be reloaded, you can make more direct use of the ASP.NET
Cache this way:

HttpContext.Cur rent.Cache

Nov 12 '05 #10

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

Similar topics

0
1443
by: Zillian | last post by:
Dear XML chiefs, I have two questions: * How many XSLs do you use for your websites? Is it better to split big Stylesheets in smaller ones (does it speed up the transformation to html?) What is the limit in lines you would recommend? * How many tags do you use? Is it better to use many or few tags?
7
7172
by: Clement | last post by:
hi, i have an asp.net site and is using SQL Server 2k. i realize the aspnet_wp.exe memory usage keep growing and i will receive an error for the pages that call the sql connection. others page with no sql connection is fined. At the time when i encounter the error, i check the memory usage for aspnet_wp.exe = 60000kb sqlmangr.exe = 40000kb
0
806
by: Alexis | last post by:
Hello, I'm working on a project that uses over a hundred XLSs for transforming xml documents. The project consists of several webservices (IIS) calling a few dlls. This dlls make the business logic and are the ones that do the transformation, so the XLSs are used by these dlls. Right now we have the XSLs files on hard disk. This means there is lots of reading from disk. Since reading from disk is much slower than reading from memory I am...
3
1685
by: patrickbeaudoin | last post by:
Hi, I have some application that use the same library in the gac. All these application use the same xml document. I would like to keep that xml document loaded in memoy and dont have to reload it all the time. Same thing for a XslCompileTransform object. It seems to be recompiles each time I use It... I would like to keep it loaded after it has been loaded once.
11
9303
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1, y1, x2, y2); }
7
7226
by: mail747097 | last post by:
I would like to keep IIS alive on my web site and prevent Application_End from occuring in global.asax. Any ideas?
4
5804
by: Daniel | last post by:
is there some per-process-limit on memory in .net processes? is there any way to increase it? i keep getting System.OutOfMemoryException when my box has 8 gigs of unused memory.
1
2306
by: =?Utf-8?B?QWxwaGFwYWdl?= | last post by:
Hello, I have built an object which does some jobs on a particular server. There can have lots of this object running concurrently. I want to know what is the best way to optimize my application: - keep all those objects alive in memory without any timeout (the object is built one time per user, then disposed when the user exits). - as I can rebuild the object, I can build the object, execute the job once, then dispose this object each...
6
2715
by: Guillermo | last post by:
Hi, I need a script to keep running in the background after it's loaded some data. It will make this data available to the main program in the form of a dictionary, but I don't want to reload the calculated data every time the user needs it via the main program. I won't be working with an UI, hope that can be made easily in Python somehow.
0
9462
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10046
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9857
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8723
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6542
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.