gambas-source-code/benchmark/string1.py
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

22 lines
380 B
Python
Executable file

#!/usr/bin/python
import time
import sys
str = 'abcdefgh'+'efghefgh'
imax = 1024 / len(str) * 512
starttime = time.time();
sys.stdout.flush()
gstr = ''
i = 0
while (i < imax+1000):
i = i + 1
gstr += str
gstr = gstr.replace('efgh','____')
lngth = len(gstr)
if (lngth % (1024*64) == 0):
print(int(time.time()-starttime),"sec\t\t",(lngth/1024),"kb")
sys.stdout.flush()