Apr 14, 2016 at 3:37 PM
After reading redcurry's excellent blog post, he mentioned that Eclipse loads all plugins into the default AppDomain. Does anyone know whether Eclipse itself is marked with either LoaderOptimization.MultiDomain or LoaderOptimization.MultiDomainHost? That way plugins creating their own AppDomains won't have to re-jit all of the system assemblies, which can cause quite a slowdown.
Apr 14, 2016 at 5:34 PM
I'm glad you liked the blog post!

I'd be interested to know the answer to your question, too. Some time ago, I tried writing a plug-in script that created its own AppDomain, but I ran into problems and haven't tried it again. I'd be interested to know if you're successful.
Apr 19, 2016 at 8:22 PM
Edited Apr 20, 2016 at 2:23 PM
After some experimentation, it looks like you can set the LoaderOptimization on the AppDomainSetup that you pass to CreateDomain. Unfortunately, all results seem to point at Eclipse itself not having the attribute set. The upshot of this is that the first time your plugin loads a new AppDomain it'll be slow, but every time after that it'll be blazing fast if you create your AppDomain with the LoaderOptimization. However, once you exit Eclipse, any benefits are lost and the plugin will start slow the next time you run it (of course, it'll be fast every time after that again). So this is mostly good news for plugins whose workflow causes them to be run several times within a session. Also note that MultiDomain will load your own assemblies--not just the system ones--into the shared domain, which can help even more.

What problems were you running into using your own AppDomain? There are several steps necessary, like using marshalable objects to pass data between the boundaries and using the Dispatcher to run any code that accesses the Eclipse APIs within the main Eclipse thread, since Eclipse doesn't have multithreading support.
Apr 20, 2016 at 2:17 AM
Interesting, I'll have to try this myself. I've been working on a "script launcher" to make launching scripts as easy as clicking on an icon (like a smartphone). Having the launcher create an AppDomain for each script would solve a lot of plug-in related problems.

I can't remember now what problems I had creating an AppDomain, but I didn't try too hard at the time.

Thanks for the info!