Hmm, which is faster?

BlitzMax Forums/BlitzMax Programming/Hmm, which is faster?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Let's say you have a method that is called extremely often. In general (I'm sure there are exceptions) is it faster to declare a local, let's say, integer, and use that, or is it faster to add an extra integer field to the type and reuse that with each call to the method?

At first I thought it'd be faster to use the pre-instantiated field value since each call to the function wouldn't allocate a new local variable. But a local variable is going to be allocated on the stack and so therefore should prove faster to access. So in general, is one method faster than another?