Report Offensive Message

Even more interesting...
Hi Mike--
I find your exuberance kind of exciting... so I had to give it a try! You said nothing is faster than HotBasic? What a challenge! Here's a simple program in HotBasic:
$APPTYPE CONSOLE
DIM u AS DOUBLE
DIM i AS DOUBLE
DIM a AS DOUBLE
DIM b AS DOUBLE
DIM c AS DOUBLE
u=TIMER
FOR i=1 TO 1000000000
b=i/2
a=i+1
c=a*(i MOD b)
NEXT i
PRINT STR$(TIMER-u)
pause
END
On a slow machine, it took 84.3 seconds. Not bad, I guess. So, how about the equivalent PowerBASIC program?
FUNCTION PBMAIN ()
DIM u AS DOUBLE
DIM i AS DOUBLE
DIM a AS DOUBLE
DIM b AS DOUBLE
DIM c AS DOUBLE
u=TIMER
FOR i=1 TO 1000000000
b=i/2
a=i+1
c=a*(i MOD b)
NEXT i
PRINT STR$(TIMER-u)
END FUNCTION
Same computer-- it took just 15.25 seconds with PowerBASIC. I guess that means PowerBASIC was 553% faster. What do you think?

How about this program?
$APPTYPE CONSOLE
defdbl x, y, i
defsng t
x = 1
y = 1.000001
t = TIMER
FOR i = 1 TO 100000000
x = x * y
NEXT
t = TIMER - t
print STR$(t)
PAUSE
END
Same slow machine -- 8.72 seconds. Not bad.

The equivalent code in PowerBASIC?
FUNCTION PBMAIN () AS LONG
x## = 1
y## = 1.000001
t! = TIMER
FOR i& = 1 TO 100000000
x## = x## * y##
NEXT
t! = TIMER - t!
PRINT STR$(t!)
END FUNCTION

Note the PowerBASIC code was calculated using extended precision variables, considerably more complex than just doubles. What was the elapsed time? 0.17 seconds. That's 5129% faster than HotBasic. It might be a good idea to consider alternative compilers.

Thanks for contributing here!

Bob Zale
PowerBASIC Inc.
Posted by bob@...
Updated - 23rd Dec 2011