A/B testing functions

BlitzMax Forums/BlitzMax Programming/A/B testing functions

Well to look up a field you have to follow a pointer or two to get to the actual memory. Parameters are on the stack. So fields on an object vs true globals are not the same thing at all.

You could try embedded functions, and use function "globals" (actually, statics) to pass the values to the function. Don't know this technique would apply to your situation.

I'm not sure where static variables are actually stored. Probably on the heap since the stack would be unwound and they preserve their values between calls. I would expect it might be faster than pushing / popping params onto the stack on every call though.

Method A()
   Global ParamA:int
   ParamA = 100
   Funcion F()
     Print ParamA
   EndFunction

   For i:int = 1 to 100
     F()
   Next
EndMethod



I guess if you're really this worried about it you might want to write this bit as a C module.