Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / May 2006

Tip: Looking for answers? Try searching our database.

How to pre-compile dynamically generated methods?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rerdavies - 02 May 2006 04:26 GMT
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.


Alvin Bruney - 02 May 2006 18:08 GMT
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.

Signature

________________________
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
-------------------------------------------------------

> NGEN.EXE will precompile MSIL to native code; actually calling a method
> will
[quoted text clipped - 8 lines]
> to
> be a better way to do this.
rerdavies - 02 May 2006 18:35 GMT
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. ;-)

> 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 -
[quoted text clipped - 15 lines]
> > to
> > be a better way to do this.
Alvin Bruney - 04 May 2006 15:20 GMT
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.

Signature

________________________
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
-------------------------------------------------------

> This would be for 2.0.
>
[quoted text clipped - 32 lines]
>> > to
>> > be a better way to do this.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.