First WCF connection made in new AppDomain is very slow

前端 未结 3 2018
不思量自难忘°
不思量自难忘° 2021-02-01 21:00

I have a library that I use that uses WCF to call an http service to get settings. Normally the first call takes ~100 milliseconds and subsequent calls takes only a few millisec

3条回答
  •  名媛妹妹
    2021-02-01 21:21

    I found the following article that talks about how only the first AppDomain can use native image dlls, so a child appdomain will always be forced to JIT lots of stuff that the initial AppDomain doesn't have to. This could lead to the performancce impact I am seeing, but would it be possible to somehow not get this performance penalty?

    If there is a native image for the assembly, only the first AppDomain can use the native image. All other AppDomains will have to JIT-compile the code which can result in a significant CPU cost.

提交回复
热议问题