Updated the attachment to the latest working python and scriptbasic scripts for benchmarking. Thanks to John's help.
John, I started to do some benchmarking, but am getting errors I can't figure out why in Scriptbasic being a noob to the language.
It is based on code here:http://onlyjob.blogspot.com/2011/03/perl5-python-ruby-php-c-c-lua-tcl.html
The benchmark as written takes too much time, so I modified it to stop after 2 results.
Here is the python script that I tested on my gaming notebook and on my android tablet.
#!/usr/bin/python -u
import re
import time
import sys
str='abcdefgh'+'efghefgh'
imax=1024/len(str)*1024*4 # 4mb
starttime=time.time();
print "exec.tm.sec\tstr.length"
gstr=''
i=0
twice = 0
while (i < imax+1000):
i=i+1
gstr+=str
gstr=re.sub('efgh','____',gstr)
lngth=len(str)*i
if(lngth % (1024*256) == 0):
print int(time.time()-starttime),"sec\t\t",(lngth/1024),"kb"
twice+=1
if(twice == 2): break # don't want to wait for the whole test
print "\nFinished"
Here is as far as I could get in SB port:
s ="abcdefgh"+"efghefgh"
imax = 1024 / LEN(s) * 1024 * 4
starttime = NOW
PRINT "exec.tm.sec\tstr.length"
gstr=""
i=0
c = 0
WHILE ( i < imax + 1000 )
i=i+1
gstr+=s
gstr=REPLACE(gstr,'efgh','____')
lngth=LEN(s)*i
IF(lngth % (1024*256) = 0) THEN
PRINT INT(NOW -starttime),"sec\t\t",(lngth/1024),"kb"
c+=1
IF c= 2 THEN GOTO finito' don't want to wait for the whole test
END IF
WEND
finito:
PRINT "\nFinished"
Results of the python tests:
Gaming Notebook Python 2.6:
exec.tm.sec str.length
3 sec 256 kb
15 sec 512 kb
Android Tablet sl4a Python:
exec.tm.sec str.length
36 sec 256 kb
157 sec 512 kb