#StackBounty: #c# #asp.net #performance #iis #unmanaged C# loading an unmanaged DLL: big performance difference between console applica…

Bounty: 250

I have a webapp written in C#, based on ASP.NET.
It loads (with LoadLibraryEx) an unmanaged DLL written with C++Builder.

As I have performance issues I made some tests and comparisons, running always the same method in the DLL, for many times, obtaining average times.

I discovered that the DLL:

  1. loaded by a C++Builder console application, takes: 4.922 s
  2. loaded by a C# console application, takes: 5.484 s
  3. loaded by a minimal C# ASP.NET application hosted on IIS 7.5, takes: 9.551 s

As you see case 1 and 2 have very similar performance.

Why case 3 is so slow? Maybe IIS slows down the DLL?

For it I ran a profiling with JetBrains dotTrace:
enter image description here

Is there any suggested IIS tuning?

Is there any suggested fast alternative to IIS for hosting ASP.NET webapps?

Should I consider porting the webapp to C++Builder?


I tried to migrate my webapp to ASP.NET Core (instead of .NET Framework) and run it on Kestrel. It takes 6.042 seconds. So, not so much overhead compared to the console app.
It seems that IIS is the culprit… why?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.