Comparison QB64 compiled with gcc optimizations and without
#23
(05-09-2022, 05:50 PM)Coolman Wrote: Picture unroller. Author James D Jarvis. Found in the forum.

8.5x seconds : program compiled with qb64 -O3
8.5x seconds : program compiled with original qb64

Tested with an image with a resolution of 1024x768.

no gain with the use of _PutImage. surprising.
Code: (Select All)
' James D Jarvis : Picture unroller
img& = _LoadImage("pic3.jpg", 32) 'your image here
w = _Width(img&)
h = _Height(img&)
sc& = _NewImage(w, h, 32)
Screen sc&
_Delay 0.1
_ScreenMove _Middle
Cls: s = 3
start = Timer(.001)
For yc = 0 To h Step s:
    _Limit 30
    _PutImage (0, 0), img&, sc&, (0, 0)-(w, yc)
    _PutImage (0, yc - 6)-(w, yc + 6), img&, sc&, (0, yc)-(w, yc + 3)
Next yc
Print Timer(.001) - start; "seconds"


It should run at 8.5 seconds no matter what if _limit is governing a significant portion of the program which it is here. Your source image tested was 768 pixels high, the program shows that image in 3 pixel high bands 30 times a second which works out to 8.5333 seconds.
Reply


Messages In This Thread
RE: Comparison QB64 compiled with Ofast and without - by James D Jarvis - 05-09-2022, 06:58 PM



Users browsing this thread: 31 Guest(s)