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

Possibly Related Threads…
Thread Author Replies Views Last Post
  niXman gcc-13.1.0 Jack 8 1,851 10-04-2023, 12:51 PM
Last Post: a740g
  BASIC's Comparison Matrix: ideas for content? CharlieJV 28 6,728 10-03-2022, 01:27 AM
Last Post: CharlieJV
  String comparison oddity...[SOLVED] Pete 6 1,293 08-05-2022, 07:16 PM
Last Post: Pete
  Found a BUG with the QB64 editor compiled with the -O3 option Coolman 2 826 06-02-2022, 06:27 PM
Last Post: Coolman

Forum Jump:


Users browsing this thread: 1 Guest(s)