Recreating them on each call is OK for really simple script usages, since multiple requests of an ASP.NET app run in the same CLR instance, and the result of ScriptRuntime.GetEngine("langName") is cached, so the app will only incur a performance hit (because of the language's assemblies JITing) on the first request. However, if you want to keep some state around, let's say by defining some functions or importing a library for your script code to use, then you'll want to at least keep track of a ScriptScope, and then you might as well keep track of a ScriptEngine as well. You can store those anywhere you'd normally store things that need to persist between requests.
~js > -----Original Message----- > From: users-boun...@lists.ironpython.com [mailto:users- > boun...@lists.ironpython.com] On Behalf Of Marco Parenzan > Sent: Tuesday, February 02, 2010 5:09 AM > To: ironruby-core@rubyforge.org; us...@lists.ironpython.com > Subject: [IronPython] Hosting DLR under ASP.NET > > Dear All, > > are there any advices about hosting DLR under ASP.NET for scripting? (not for > views!)? > Where hosting ScriptingRuntime, ScriptingEngine? > As static variables in Global.asax? In Application? > Where hosting ScriptingScope? In Session? Destroy and reistantiate at each > call? > > I have to develop an ASP.NET MVC application, with no serious performance > issues, but I don't want to abuse... > > Thanks in advance > > Marco Parenzan > > _______________________________________________ > Users mailing list > us...@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core