Is this an issue?
#6
Aye, the issue is as Matt stated: *All QB64 subs and functions come with some built in overhead.*

In this case, the function you produce is basically:

Function Add (v1, v2)
Step 1: Check for errors. If any, send error message. Pause.
Step 2: Check for break/exit conditions. Ctrl-C, or Red X in top right of Window. Quit if clicked.
Step 3: Allocate temp variable.
Step 4: Add v1 + v2, assign to temp
Step 5: Assign temp to Add for return value
Step 6: Cleanup temp variables
END FUNCTION

Compared to a base C function of:

Function Add (v1, v2)
Return v1 + v2
END FUNCTION

If necessary, you can remove some of that overhead with $CHECKING:OFF before your Function, but be aware that it'll disable the check for exit conditions and error reporting, if you do so. (And remember to turn $Checking:On after the Function.)

But I think the example above easily explains why you're seeing the results you're seeing here. Wink
Reply


Messages In This Thread
Is this an issue? - by bobkreid - 07-01-2022, 07:56 PM
RE: Is this an issue? - by bplus - 07-01-2022, 11:00 PM
RE: Is this an issue? - by Kernelpanic - 07-01-2022, 11:42 PM
RE: Is this an issue? - by Kernelpanic - 07-01-2022, 11:57 PM
RE: Is this an issue? - by DSMan195276 - 07-02-2022, 12:32 AM
RE: Is this an issue? - by bobkreid - 07-03-2022, 10:27 AM
RE: Is this an issue? - by SMcNeill - 07-02-2022, 01:10 AM
RE: Is this an issue? - by bobkreid - 07-03-2022, 10:35 AM
RE: Is this an issue? - by madscijr - 07-02-2022, 09:35 PM
RE: Is this an issue? - by DSMan195276 - 07-03-2022, 05:48 AM
RE: Is this an issue? - by madscijr - 07-03-2022, 03:05 PM
RE: Is this an issue? - by DSMan195276 - 07-04-2022, 03:48 AM



Users browsing this thread: 2 Guest(s)