This website has various benchmark tests and articles that claim or express that
PowerBasic compilers faster code than C.. Or- something to that
effect..
Well I created this simple routine that will randomly fill an array with colors
When the array is filled the program will send the array to a PictureBox
in VB. The dissapointing part about this routine is that it is incredibly
slow. If i wrote this routine in C, I think I would get better results..
Can someone explain to me, why? Or maybe give me some incite on what
commands optimize during execution... I can't understand why the
performance is so slow? This is a 16bit DLL compiler, would 32bit improve this?
$HUGE
$COMPILE DLL
$INCLUDE "C:\DEVEL\EV3\DLL\WINAPI.INC"
Sub RandomizeBMP (ByVal hDC%, ByVal bWidth%, ByVal bHeight%) EXPORT
Dim x%, y%, color As WORD, acnt As DWORD, ok As DWORD
Dim TOTALBYTES As DWORD
TOTALBYTES = bWidth% * bHeight%
ReDim bmpdata(TOTALBYTES) as WORD
acnt = 0
For y% = 0 to bHeight%-1
color = int(65000 * rnd(1))+1
For x%= 0 to bWidth%-1
bmpdata(acnt) = color
incr acnt
Next x%
Next y%
ok = SetBitmapBits(hDC%, TOTALBYTES*2, bmpdata(0))
End Sub
------------------
Explorations v3.0 RPG Development System
http://www.explore-rpg.com
PowerBasic compilers faster code than C.. Or- something to that
effect..
Well I created this simple routine that will randomly fill an array with colors
When the array is filled the program will send the array to a PictureBox
in VB. The dissapointing part about this routine is that it is incredibly
slow. If i wrote this routine in C, I think I would get better results..
Can someone explain to me, why? Or maybe give me some incite on what
commands optimize during execution... I can't understand why the
performance is so slow? This is a 16bit DLL compiler, would 32bit improve this?
$HUGE
$COMPILE DLL
$INCLUDE "C:\DEVEL\EV3\DLL\WINAPI.INC"
Sub RandomizeBMP (ByVal hDC%, ByVal bWidth%, ByVal bHeight%) EXPORT
Dim x%, y%, color As WORD, acnt As DWORD, ok As DWORD
Dim TOTALBYTES As DWORD
TOTALBYTES = bWidth% * bHeight%
ReDim bmpdata(TOTALBYTES) as WORD
acnt = 0
For y% = 0 to bHeight%-1
color = int(65000 * rnd(1))+1
For x%= 0 to bWidth%-1
bmpdata(acnt) = color
incr acnt
Next x%
Next y%
ok = SetBitmapBits(hDC%, TOTALBYTES*2, bmpdata(0))
End Sub
------------------
Explorations v3.0 RPG Development System
http://www.explore-rpg.com
Comment