Skip to Content

JIT compilation of SAP proxies

Hello,

I am using a C# program as an external interface to SAP thru .net connector generated proxies.

whenever I try to create an instance of the proxy, it compiles it at the following line of code.

SAPProxyDll1.SAPProxyDll1 prox = new SAPProxyDll1.SAPProxyDll1();

This affects the performance a lot because I have a query based connection and for every query it goes thru the compilation cycle (of around 7-8 seconds).

Is there a way to avoid this? I tried using NGEN to register the SAP.connector.dll and my proxy dll, but that didn't resolve it.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 11, 2004 at 04:06 PM

    Thanks a lot. I will change my code to retain the proxy longer.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 11, 2004 at 07:31 AM

    Ah, thanks for the interesting question.

    Well, you are right that the construction of a proxy is time consuming, but not as you assume because of JITting, but because all proxies ultimately inherit from Microsoft's SoapHttpClientProtocoll class for WebService clients. This class creates a XML Serializer for the Soap serialization - which in fact create some temporary C# files which are compiled to a temporary assembly.

    This is indeed a slow process.

    Currently MS doesn't allow to pre-generate the XML serializer DLL. This feature is announced for next .NET Release "Whidbey".

    Anyway, you can easily workarround the issue by keeping the proxy for a longer time. E.g. you can have the proxy as a member variable of your application or form class.

    Add comment
    10|10000 characters needed characters exceeded