26-11-2006, 12:10 AM
I did the same test w/ C++, direticly from it, no DLL. It was pretty much faster!
Verrigan told me about VB's compiling stuff and I made it much faster, selecting that options, but it stills slower than C++.
I used a simple sum function, I dont think there is a way to make sum faster. If there is, tell me ^^
I'll post in a few minutes the times I get on my computer.
EDIT:
All tests were are like this:
start count
for i = 1 to 10^6
tmp=sum(i,i)
next i
tells me the time lapsed, in miliseconds.
I tried the 2 types of sending the values, ByVal and ByRef, for VB and C++, so I'll show you both results. All resulst are the best one I could get on my computer.
Thru VB:
VBFunction(ByVal): 63
VBFunction(ByRef): 78
C++Function(DLL,ByVal): 125
C++Function(DLL,ByRef): 141
Thru C++:
C++Function(ByVal): 31
C++Function(ByRef): 46
This tests showed me that C++ was much faster than VB in all cases.
Verrigan told me about VB's compiling stuff and I made it much faster, selecting that options, but it stills slower than C++.
I used a simple sum function, I dont think there is a way to make sum faster. If there is, tell me ^^
I'll post in a few minutes the times I get on my computer.
EDIT:
All tests were are like this:
start count
for i = 1 to 10^6
tmp=sum(i,i)
next i
tells me the time lapsed, in miliseconds.
I tried the 2 types of sending the values, ByVal and ByRef, for VB and C++, so I'll show you both results. All resulst are the best one I could get on my computer.
Thru VB:
VBFunction(ByVal): 63
VBFunction(ByRef): 78
C++Function(DLL,ByVal): 125
C++Function(DLL,ByRef): 141
Thru C++:
C++Function(ByVal): 31
C++Function(ByRef): 46
This tests showed me that C++ was much faster than VB in all cases.