Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Performance issue when you use WCF to send XML SOAP messages in the .NET Framework 4.6


View products that this article applies to.

Symptoms

Assume that you have upgraded to Microsoft .NET Framework 4.6 on your computer. When you use an application that uses Windows Communication Framework (WCF) to send XML SOAP messages, the encoding may take slightly longer. In some cases, this might affect the rate at which a server application can process requests.

↑ Back to the top


Cause

This issue occurs because of a new Just-In-Time (JIT) compiler that is named RyuJIT. This compiler uses different optimizations than the legacy JIT64 compiler. A method on a hot code path for encoding strings in the XmlDictionaryWriter is not optimized for the new JIT compiler and the generated native instructions run slower and the encoding takes longer. When a SOAP message contains a large number of strings to be encoded, this slower code is used more frequently and may affect the encoding time.

↑ Back to the top


Resolution

To work around this issue, configure the application to disable the use of ngen for the System.Runtime.Serialization.dll assembly and to use the legacy JIT engine. To do this, use one of the following methods:
  • Set the following environment variables:

    COMPLUS_useLegacyJit=1
    COMPLUS_DisableNativeImageLoadList=System.Runtime.Serialization
  • In the registry, create either of the following subkeys:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework

    Then, add the following values:
    • Key name: useLegacyJit
      Type: REG_WORD
      Value: 1
    • Key name: DisableNativeImageLoadList
      Type: REG_SZ   
      Value: System.Runtime.Serialization
  • Add the following text to the <app>.exe.config file . Create the indicated sections if they do not already exist.
    <configuration>
    <runtime>
    <useLegacyJit enabled="1">
    <disableNativeImageLoad>
    <assemblyIdentity name="System.Runtime.Serialization" />
    </disableNativeImageLoad>
    </runtime>
    </configuration>


For more information about the known issues in the .NET Framework 4.6, see Known issues for the .NET Framework 4.6 .

↑ Back to the top


More Information

For more information about the product versioning changes and their effects in the .NET Framework 4.6, see Application Compatibility in the .NET Framework 4.6.

↑ Back to the top


Keywords: kbsurveynew, kbexpertiseadvanced, kbtshoot, kb

↑ Back to the top

Article Info
Article ID : 3076436
Revision : 1
Created on : 1/7/2017
Published on : 7/20/2015
Exists online : False
Views : 570