» Home » VB Fibre
Site
News
Files

Visual Basic
Strings
Math
General
Properties
Memory
Methods

Search
Testing

Inline ASM-VB
Strings
Math
General
Memory

Search
Using inline ASM
Submit!

To call or not to call?

The difference between call or no call is very small. The funny thing is that there's a difference if you call a sub or a function. That's why I'm probably going to add another test to check if "no call" is faster for subs. The results of this test are based on a function, the function returns a string.

Code:
Public Function TestOne() As String TestOne = "empty" End Function

This was function was called 500.000 times using "Call Testone" and "Testone", and done 5 times

Code:
TestOne

Code:
Call TestTwo

call % faster than no call call (sec) no call (sec)
-2,2% 0,261654 0,267618
-0,1% 0,256037 0,256384
1,1% 0,259373 0,256454
2,1% 0,260969 0,255651
-0,3% 0,258496 0,259254


User contributed notes:

Author: Me () Date: 22:03 02/03/2005
FYI, using call or not makes no difference in compiled code...

Author: Almar () Date: 22:03 02/03/2005
Well, that's what the test says, doesn't it? :).

Add user-note
Author:
E-mail (optional):
Anti spam, please enter 'ok' without quotes:
Comment: