[futurebasic] Re: [FB] random strings

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1998 : Group Archive : Group : All Groups

From: Al Pastor-Serrano <apastor@...>
Date: Wed, 28 Oct 1998 00:31:21 +0100

Jay Reeve wrote:I've often wondered whether there is a speed difference between

>   LEN(given$)
> and
>   PEEK(@given$)
> ? Guessing again, I would think the former would call a FB subroutine to
> do the latter, while the latter would compile directly, avoiding the
> subroutine overhead. Easy to check in Macsbug, but who has time?
>

Hello Jay,

I had a run in Macsbug for you.
As you already know, I have no skill in asm but I tested some code and it seems
that there is no difference in the code generated by the compiler. It's just a
matter of moving a byte in some register. The only difference is from where the
byte is taken. so, no subroutine here.
I tried a variant of my test where the var you called given$ was global or not.
When given$ was not set as a global it gave two instructions more with
PEEK(@given$).
I used to think in the same way as you do, changing some code expecting a speed
improvement.
Well I must go back to work after this testing.
Of course, this must be approved by some guru.

See you.

Alain