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: [email protected] [mailto:users-
> [email protected]] On Behalf Of Marco Parenzan
> Sent: Tuesday, February 02, 2010 5:09 AM
> To: [email protected]; [email protected]
> 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
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core