cancel
Showing results for 
Search instead for 
Did you mean: 

JIT compilation of SAP proxies

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

reiner_hille-doering
Active Contributor
0 Kudos

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.