Open Forum > What's New

ScriptBasic for Android

<< < (8/15) > >>

Support:
I solved the problem with REPLACE and happy with the results.


--- Quote ---Test code grows text string by adding another string in cycle until it grows up to 4 mb. Each iteration substitutes some text. Every time string becomes 256 KiB larger program prints number of seconds passed since beginning of test.

--- End quote ---



--- Code: ---s ="abcdefghefghefgh"
i_max =  1024 / LEN(s) * 1024 * 4

starttime = NOW
PRINT "exec.tm.sec\tstr.length\n"

gstr=""
i=0
c = 0
WHILE ( i < i_max + 1000 )
  i=i+1
  gstr&=s
  lngth=LEN(s)*i
  gstr=REPLACE(gstr,"efgh","____",undef,lngth-16)
  IF(lngth % (1024*256) = 0) THEN
    PRINT INT(NOW -starttime)," sec\t\t",(lngth/1024)," KB\n"
    c+=1
    IF c= 2 THEN GOTO finito
  END IF
WEND

finito:
PRINT "\nFinished\n"

--- End code ---

jrs@laptop:~/sb/test$ scriba kentbench.sb
exec.tm.sec   str.length
5 sec      256 KB
34 sec      512 KB

Finished
jrs@laptop:~/sb/test$


--- Code: ---abcd____________

abcd____________abcd____________

abcd____________abcd____________abcd____________

abcd____________abcd____________abcd____________abcd____________

--- End code ---

I compiled the C version for a reference base. (1st MB)

jrs@laptop:~/sb/bench$ ./cstr
exec.tm.sec   str.length
2sec      256kb
6sec      512kb
17sec      768kb
34sec      1024kb
^C
jrs@laptop:~/sb/bench$

kryton9:
Nice updates John. The author of the benchmarks wrote that he wasn't going for optimization's and trying to keep the code uniform across all languages. But it is interesting to see how you did your improvements.
I did the java test on the notebook. It runs through eclipse, but not stand alone.
notebook:
exec.tm.sec   str.length
8sec      256kb
34sec      512kb

To run you need to unzip the attachment into your eclipse workspace folder and open it from the project menu in eclipse and then run.

Support:
Kent,

I don't have Eclipse installed and don't want to trash my development system with installing Java and all the other dependencies that go with it. I'll take your word on the results and factor the numbers based on your Python run on your gaming netbook.

John

kryton9:
I understand John, in fact it is so screwy now with Java. You have Java and OpenJava, there is version 6 the stable release and 7 which has quirks. I never cared for Eclipse, too me it is buggy compared to other IDE's I use. I just installed it to tinker with Android and what you are doing with SB and Android. I personally am not happy with Android, it is not what I expected. For a phone it is fine, but for a true cross platform OS, it doesn't have the right foundation in my book.

I just look at my tablet as a media source at bedtime anymore. It is not the development toy I thought it was going to be.

Support:

--- Quote ---I just look at my tablet as a media source at bedtime anymore. It is not the development toy I thought it was going to be.
--- End quote ---

Don't give up so soon. You haven't even played with the GUI yet. (fullscreen, controls, events, ...) The SQLite3 Facade is coming from what I have been told. I plan to use SB Android on a pad with an open source medical practice package as the input device.

Check out the Android Framework PDF I attached.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version