Groups | Blog | Home
all groups > dotnet performance > october 2003 >

dotnet performance : How to shorten startup time on low power machine?


news.microsoft.com
10/23/2003 2:14:04 PM
I've to run .net applications on a low power machine (366mhz and 96mb ram!).
Unfortunately this application needs about 23 seconds to startup, which
isn't acceptable. The app uses a custom library which in turn uses DirectX9
managed extensions.
This library (assembly) contains about 10 assembly references. So I used
'ngen' to create native images of these assemblies. However this doesn't
help.

Are there other ways to improve the startup time?
How can I accelerate loading assemblies? Can I disable some security checks
for instance? (I use the default machine configuration so far)
Is there a way to keep assemblies loaded?

Any tips, hints, and tricks are welcome.

Thanks, Claus

Jason Smith
10/24/2003 9:29:02 PM
96 megs isn't a whole lot. Are you running into any memory thrashing?
Check Task Manager to see if you are using more memory than is physically
available in the machine. If so, upgrade to 128MB.

It sounds like you have done most everything you can do to speed up .NET.
But you are using not only DirectX managed extensions, but also DirectX
underneath, plus probably a bunch of other libraries.

Does it run as slowly on a 366MHz machine with 256MB of RAM? That would be
a clue right there.

Have you tried it with different operating systems? Windows 98 is going to
have a much smaller footprint than Windows Server 2003...

[quoted text, click to view]

Jason Evans
10/27/2003 3:55:49 PM

Hi there.

From what I've read about .NET in general, a few concepts of the
framework relies on computer hardware becoming faster and hard drives
becoming bigger. So, for example, the idea of running assemblies
side-by-side is now more acceptable as these days RAM is cheaper. So
Microsoft didn't worry too much about making .NET optimised to run on
older computer's.

Running a .NET app on a 366MHz computer is a no win situation I feel.
Such has been mentioned I would certainly recommend increasing the RAM
to at least 256MB, providing that the type of RAM you need is still
available. I wouldn't waste too much of your time on this.

Ori_Gershony NO[at]SPAM online.microsoft.com
10/27/2003 5:36:46 PM

Have you tried profiling your application? Things are not always what they
appear, and you never know what is actually happening at startup time until
you measure it. Beyond that, my tips would be:

1) Make sure you ngen all the assemblies that are used at startup
(including the application). If you see mscorjit.dll loaded into your
process, it means that you missed something (or that the application is
generating code dynamically which is an even bigger perf problem).
2) After you profile your application, see if you can avoid loading some of
the assemblies (by deferring initialization until later, or maybe not using
them at all). Avoiding assembly loads can give you big wins.

Good luck!

-- Ori.

--------------------
[quoted text, click to view]


--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
news.microsoft.com
10/30/2003 6:24:57 PM
Thanks for 'mscorjit.dll' hint.
It seems that not all of our referenced assemblies are native images.
Is there a tool that simply ngen all referenced dlls of an specified
assembly? Or is there a tool that creates native images of all assemblies in
the gac at least.
(Getting this information out of the manifest file manually, isn't a
convenient way ;-)!)

Thanks for your response,
Claus

"Ori Gershony [MSFT]" <Ori_Gershony@online.microsoft.com> schrieb im
Newsbeitrag news:H0gGnDLnDHA.2148@cpmsftngxa06.phx.gbl...
[quoted text, click to view]

Frank Hileman
10/31/2003 3:09:57 PM
[quoted text, click to view]

Great idea! - Frank

Ori_Gershony NO[at]SPAM online.microsoft.com
10/31/2003 6:36:21 PM

Unfortunately such a tool does not exist at this time. You will have to go
through your manifests and ngen the transitive closure of all your
dependencies. The .Net Framework installer will automatically ngen many of
the system libraries, but you will have to ngen everything else that you
need when doing your setup. Note that you only need to ngen assemblies
that actually get loaded into your process (it's OK to reference a
non-ngened assembly that is never used).

We are investigating implementing such a tool for a future release of the
.Net Framework. We may even automate it in the form of a service that will
generate ngen images in the background for frequently used assemblies (so
even if you didn't ngen your assemblies during setup, they will eventually
get ngened).

-- Ori.

--------------------
[quoted text, click to view]
<udIflgqmDHA.684@TK2MSFTNGP09.phx.gbl>
<H0gGnDLnDHA.2148@cpmsftngxa06.phx.gbl>
[quoted text, click to view]


--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
Conrad Zhang
11/1/2003 10:45:31 PM
You can easily write a script for the second part,

run "gacutil -l", get all the assemblies, then run ngen on each one.

ngen works on file path as well as assembly name, as long as the assembly
can be found by normal probing rule.

for example, try "ngen
system,Version=1.0.5000.0,Culture=neutral,PublicKeyToken=b77a5c561934e089"

[quoted text, click to view]

AddThis Social Bookmark Button