简体   繁体   中英

Performance benefits of Appdomain vs process?

I have an C# application (foo) from which I am calling another C# application (bar). Currently I am invoking bar application from foo application by creating new process using Process class of C#.

Recently I came to know about .net AppDomains. I would like to know is there any performance benefit for using AppDomains instead of process?

Thanks and Regards,

There is some non-insignificant overhead in Windows of simply creating a new process, yes. This is why CGI has historically not performed as well on Windows as on other operating systems (and a big reason why FastCGI was developed instead)

However, I would ask how frequently are you going to be creating these extra 'jobs'? If it's going to be very frequent, is there a reason you can't simply use a thread pool thread? If it's not going to be frequent at all, the benefit you would gain would be minor compared to the time you will spend figuring out how to get it to work.


IMO, separate AppDomains tend to have some specific situations that call for their use over a full process or a simple thread. It's usually better to go one way or the other.

Creation of a process in .net framework is not a managed process , CLR has to consult underlying OS to initiate a new process and initiating a new process has some defined steps so there may be some performance degradation but how much , there is no measurement.

But , if you load your DLL into a new AppDomain, that will be inside your application process and would not require a full flash process set.

so that depends , how are you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM