Comparison QB64 compiled with gcc optimizations and without - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: Chatting and Socializing (https://staging.qb64phoenix.com/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://staging.qb64phoenix.com/forumdisplay.php?fid=2) +--- Thread: Comparison QB64 compiled with gcc optimizations and without (/showthread.php?tid=366) |
RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-09-2022 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 RE: Comparison QB64 compiled with Ofast and without - Jack - 05-09-2022 hello Coolman in this example _Limit 30 is the speed limiter/throttle, to decrease the runtime increase _Limit, try it with _Limit 40 RE: Comparison QB64 compiled with Ofast and without - James D Jarvis - 05-09-2022 (05-09-2022, 05:50 PM)Coolman Wrote: Picture unroller. Author James D Jarvis. Found in the forum. 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. RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-09-2022 thanks Jack. i came to the same conclusion. even with _Limit 40 it doesn't change anything. no speed gain. it seems that using _Limit distorts the result. the goal is to know if the _PutImage command is optimizable, I removed _Limit. it's too fast to compare, so I added a loop for a 10 times display. Picture unroller. Author James D Jarvis. Found in the forum. 1.3x seconds : program compiled with qb64 -O3 2.5x program compiled with original qb64 this time the gain is visible. Code: (Select All) ' James D Jarvis : Picture unroller Another example. New screen - How ?. Found in the old forum. 1.4x seconds : program compiled with qb64 -O3 2.3x seconds : program compiled with original qb64 if you uncomment the line '_Limit 30, the gain will be zero. if you want to test, put 100 instead of 1000 in the loop. Code: (Select All) Screen1 = _NewImage(640, 480, 32) RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-09-2022 thank you James D Jarvis. i missed your message. finally i removed the _LIMIT command and i got the answer i wanted. RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-10-2022 hello. i would like to test disk access by loading a large text file and manipulating it to do string searches. to do a speed comparison between the qb64 optimized O3 version and the original version. if you have a code. please post it. RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-10-2022 here is a very simple code that opens a text file of about 4 mo to read it line by line three times in a row with the use of Left$ InStr. the speed gain is not very important but it is always better with qb64 compiled with the -O3 option. you need a text file of about 4 MB to test. i found the test file in the compressed archive Common Resource Files on this forum. you can find it here : https://staging.qb64phoenix.com/showthread.php?tid=327 6.5x seconds : program compiled with qb64 -O3 7.2x seconds : program compiled with original qb64 Conclusion : disk accesses don't advantage much the version of qb64 compiled with the -O3 option. don't forget that modern operating systems use a disk cache in memory, which can distort the results. Code: (Select All) $Console RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-10-2022 here is a very simple code that opens a text file of about 4 mo to read it line by line and copy it to a new file. Here the speed gain is practically zero. you need a text file of about 4 MB to test. i found the test file in the compressed archive Common Resource Files on this forum. you can find it here : https://staging.qb64phoenix.com/showthread.php?tid=327 3.0x seconds : program compiled with qb64 -O3 3.0x seconds : program compiled with original qb64 Conclusion : in file reading and writing. no visible speed gain. don't forget that modern operating systems use a disk cache in memory, which can distort the results. Code: (Select All) $Console RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-11-2022 here is another very simple code that copies a test file of about 4 mo to an array and copies the data randomly to another array. you need a text file of about 4 MB to test. i found the test file in the compressed archive Common Resource Files on this forum. you can find it here : https://staging.qb64phoenix.com/showthread.php?tid=327 program compiled with qb64 -O3 4.4x seconds : Read file and copy to table 7.1x seconds : Copy data randomly into another table. program compiled with original qb64 5.9x seconds : Read file and copy to table 27.4x seconds : Copy data randomly into another table. Code: (Select All) $Console RE: Comparison QB64 compiled with Ofast and without - Coolman - 05-13-2022 I found this code in the old forum apparently created by SMcNeill. Here, the interest is to see the difference in processing speed between the version of QB64 compiled in -O3 and the original version : 13.2x seconds : program compiled with qb64 -O3 26.2x seconds : program compiled with original qb64 Code: (Select All) Screen _NewImage(1280, 720, 32) |