Thread: how slow is calling a dll?

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    23

    how slow is calling a dll?

    how fast (or slow) are the calls to dlls?
    if i called a dll every step of my game, would chaos ensue?

    usind VC++
    let us eat and drink

  2. #2
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    I doubt it becuase so many programs and games on the shelf use dlls quite often

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    If you want the func to be executed very fast, and if you are calling it repeatedly then I wouldt bother with Dlls........put the code in your main module and use the "inline" keyword where appropriate.

    When you call a dll....it does something like

    CALL Entry in Imported Jumptable
    JMP To Functiontable in Dll
    JMP To Actual Function in Dll

    Now you can optimise this if your compiler supports __declspec(dllexport/dllimport), so the call goes straight to the Functiontable in the dll.....but it will still be quicker in your exe and you can use stuff like "inline"....

    There are apps that allow you to Bind a dll and an exe, so there is just 1 call...but then you have to guess what was the point in using a dll in the first place!

    For stuff that's not so critical, and assuming you are going to want to update those modules, or you want to share that code amongst your other apps...then fine use a dll

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    23
    thanks
    let us eat and drink

  5. #5
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    I'd say the overhead is negligible.
    DirectX uses DLL-calls for all operations.

    If the DLL is loaded run-time, the call is negligible.
    Last edited by Sang-drax; 09-15-2002 at 08:51 AM.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #6
    Registered User
    Join Date
    Sep 2002
    Posts
    23
    conclusion:
    it wont kill me
    let us eat and drink

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DLL Calling Question
    By mercury529 in forum Windows Programming
    Replies: 11
    Last Post: 01-09-2007, 06:15 PM
  2. problem in calling DLL
    By bhagwat_maimt in forum C++ Programming
    Replies: 2
    Last Post: 11-19-2006, 10:43 PM
  3. Calling a DLL
    By jamez05 in forum C++ Programming
    Replies: 1
    Last Post: 01-05-2006, 11:13 AM
  4. Troubles Calling a DLL
    By jamez05 in forum C++ Programming
    Replies: 2
    Last Post: 12-02-2005, 12:00 PM
  5. Calling a VB DLL w/ forms from C++ DLL
    By UW_COOP in forum C++ Programming
    Replies: 8
    Last Post: 06-30-2003, 08:04 AM