gambas-source-code/benchmark/string1.gbs
Benoît Minisini de200aac4c Add a new 'btree' benchmark, that does a lot of object creation and recursive function calls.
[BENCHMARKS]
* NEW: Add a new 'btree' benchmark, that does a lot of object creation and recursive function calls.
* NEW: Rename the 'string' benchmark as 'string1', to avoid name clashes in Python.
* BUG: Fix the HTML table generation.
2023-10-04 22:10:01 +02:00

23 lines
388 B
Text
Executable file

#!/usr/bin/env gbs3
Dim S As String = "abcdefgh" & "efghefgh"
Dim M As Integer = (1024 \ Len(S)) * 512
Dim G As String
Dim I As Integer
Dim L As Integer
Dim F As Float = Timer
While I < M + 1000
Inc I
G &= S
G = Replace(G, "efgh", "____")
L = Len(G)
If L Mod (1024*64) = 0 Then
Print CInt(Timer - F);" sec\t\t";L \ 1024;"kb"
Flush
Endif
Wend
Error CStr(Jit.Time)