all groups > dotnet performance > may 2006 >
You're in the

dotnet performance

group:

How to pre-compile dynamically generated methods?


How to pre-compile dynamically generated methods? rerdavies
5/1/2006 8:26:01 PM
dotnet performance:
NGEN.EXE will precompile MSIL to native code; actually calling a method will
compile the MSIL to native. Is there another way to do this?

The application: an audio programming language, where the cost of the
initial JIT compile in the pretty-darned-close-to-realtime thread is not
acceptable.

The proof-of-concept code , as a temporary workaround, uses a flag to make
called methods do nothing, just so I can get them compiled. But there has to
be a better way to do this.


Re: How to pre-compile dynamically generated methods? rerdavies
5/2/2006 10:35:02 AM
This would be for 2.0.

A global configuration option sounds promising. A method for actually
forcing the compile without calling the method would be even better, if the
global configuration option does it on a background thread basis.

If you could provide a hook or a starting point (method, search term,
broad-strokes concept), I would be very grateful. I can run down the details.
For some reason a search on ".net warming" returns lots of information on
Global Warming of the planetary kind, even on site:microsoft.com. ;-)



[quoted text, click to view]
Re: How to pre-compile dynamically generated methods? Alvin Bruney
5/2/2006 1:08:38 PM
What framework is this? 1.x or 2? For 2, .NET allows you to warm an
application. This is configurable and basically just calls each method -
similar to ngen. For 1.x, you will have to write a manual warmer
application. You can get clever by wrapping the warmer call inside a static
method. When the thread of initialization passes thru sometime before the
application actually starts up, your methods should be nice and ready.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

[quoted text, click to view]

Re: How to pre-compile dynamically generated methods? Alvin Bruney
5/4/2006 10:20:13 AM
Seems I was mistaken here, the only site warmer I can find exists for
ASP.NET applications. The warmer allows you to warm the application on a
website basis which is not what you are looking for. Aside from using ngen,
or rolling your own code to call the method, I'm out of ideas on this one.
It does seem like a good feature request though for the .net tools.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

[quoted text, click to view]

AddThis Social Bookmark Button