c# - What could cause slowness when calling methods from a separate app domain? -
i setup appdomain ironpython run in:
var appdomainsetup = new appdomainsetup { applicationbase = sandboxpath }; var sandbox = appdomain.createdomain("sandbox", evidence, appdomainsetup, permissionset);
when sandboxpath
set exe directory, calls made scripts "fast." when sandboxpath
set folder containing necessary dlls (basically classes scripts call , relevant ironpython dlls) scripts' calls "slow." important note these calls crossing main appdomain sandbox appdomain. issue brought number of questions due lack of understanding of how ironpython works , searching has led me in few circles. my main question how , when ironpython load assemblies , how having using separate directory base decrease performance?:
do assemblies loaded on appdomain construction? can read how appdomain goes loading assemblies , assembly loader?
- this article mentions setting applicationbase property determines "where assembly loader begins probing assemblies load new application domain."
when call python.createengine new appdomain happening?
- i see creates script runtime. if preload assemblies perhaps performance hit go away? or setting base preload assemblies in base directory?
finally, have class typea
in types.dll can shared across appdomains , dictionary class in have bunch of typeas stored. these typeas set c# side of things (as part of main.proj). storage class has proxy scope value class can accessed ironpython scripts (this scope value in sandbox.proj). separate directory setup above, have 2 types.dll, 1 in exe directory , 1 in sandbox directory. c# project built reference 1 in exe directory while assume ironpython referencing 1 in applicationbase directory. why isn't problem? potential issue here? know fixable don't understand why works. summing up: have 2 identical dlls loaded 2 separate appdomains communicate each other passing class in dlls around it's not same class.
dependencies:
main.proj -> types.dll // set typeas read file or network sandbox.proj -> types.dll // read in scripts
folder structure:
bin/main.exe bin/types.dll bin/sandbox/sandbox.dll bin/sandbox/types.dll
any , comments welcome.
Comments
Post a Comment