Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:09:13+00:00 2026-05-26T00:09:13+00:00

I have a win32 dll and two applications which uses the same dll. One

  • 0

I have a win32 dll and two applications which uses the same dll. One is written using c in unmanaged space and the other is the .net application which makes call to the unmanaged code using Pinvokes.

Sometimes the performance of the .net application is better than the c application. Technically speaking invoking unmanaged code from .net incurs performance overhead but not in this case.

I checked the msdn reference and there seems to be some kind of preprocessing that happens before actual call is made. During linkage the dll is loaded.

I want to understand in what scenarios .net application outperforms?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:09:14+00:00Added an answer on May 26, 2026 at 12:09 am

    The pinvoke marshaller is one of the heaviest optimized chunks of code in the .NET framework. Very important, there’s lots of pinvoke you cannot see when running a managed program on an unmanaged operating system. The amount of overhead is highly variable. It is but a handful of cpu cycles when the DLL is already loaded and the arguments to the pinvoked function are simple integral types. To many hundreds of cycles when, say, string conversions are necessary.

    In no circumstance is it ever faster than a native call. Measuring overhead that’s only a handful of cycles accurately is difficult. And keep in mind that you might unintentionally measure the perf of your test program instead of the pinvoke call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VS2008 solution containing two C++ projects. One is a Win32/console .dll
I have a .NET application that makes calls to a native Win32 DLL using
I have two WIN32 DLL projects in the solution, main.dll should call a function
I have a a Win32 DLL project in VS2008, it is written in a
I have a third-party (Win32) DLL, written in C, that exposes the following interface:
I have created a minidump using win32 api [DllImport(DbgHelp.dll, SetLastError = true)] private static
I have successfully implemented interop beftween Win32 application and managed .Net dll as described
we have a C++ Win32 DLL that reads data from Excel. The application uses
First_Layer I have a win32 dll written in VC++6 service pack 6. Let's call
I have a win32 library (DLL) project that was originally written in Delphi. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.