DLL question for B3D

Community Forums/General Help/DLL question for B3D

Adam Novagen(Posted 2009) [#1]
Hey all,

This is only a semi-Blitz-related question, so I put it here. Anyway. ^_^

First off, I know (or at least believe) that DLL userlibs extensions are programmed in C# (or C++ ?). Does that make a DLL function faster than a Blitz function? For instance, if you had a Blitz function like, I dunno...

Function DoSomethingAlready(Number)
    Return Number + Number * Number / 50
End Function

Would a DLL version of DoSomethingAlready(), designed to do the exact same thing, work faster than the straight Blitz version?


Gabriel(Posted 2009) [#2]
First off, I know (or at least believe) that DLL userlibs extensions are programmed in C# (or C++ ?).

They can be programmed in just about any language, since many different languages (including BlitzMax) can compile to a DLL. It's possible, but unlikely, to be written in C#, since C# needs a fair bit of fiddling in order to compile a pure Win32 dll.

Does that make a DLL function faster than a Blitz function?

Sometimes yes, sometimes no. It depends on what it's doing, what language it was written in and how well written the code is.

Would a DLL version of DoSomethingAlready(), designed to do the exact same thing, work faster than the straight Blitz version?

It would depend on what language it was written in and how well it was written, but it's unlikely as the overhead of an extra function call would surely wipe out any tiny improvement you got in such a tiny bit of logic.


Adam Novagen(Posted 2009) [#3]
Okay, that helps me a lot. Thanks Gabriel!