Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comparison QB64 compiled with gcc optimizations and without
#28
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://qb64phoenix.com/forum/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
Screen 0
start = Timer(.001)
Color 7: Print "Wait..."
Open "370099 Word List.txt" For Input As #1
Open "370099 Word List_output.txt" For Output As #2
Do
    Line Input #1, chaine$
    If EOF(1) Then
        Print #2, chaine$;
    Else
        Print #2, chaine$
    End If
Loop Until EOF(1)
Close #1
Close #2
Color 3: Print: Print Timer(.001) - start; "seconds"
Color 7
End
Reply


Messages In This Thread
RE: Comparison QB64 compiled with Ofast and without - by Coolman - 05-10-2022, 04:52 PM



Users browsing this thread: 35 Guest(s)