Oxygen Basic
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Latest OxygenBasic.zip at GitHub
(Click on the Wizard)
Home
Help
Search
Login
Register
Oxygen Basic
»
Programming
»
Example Code
»
Small benchmark...o2-PB-FB
« previous
next »
Print
Pages: [
1
]
Author
Topic: Small benchmark...o2-PB-FB (Read 1919 times)
0 Members and 1 Guest are viewing this topic.
Aurel
Guest
Small benchmark...o2-PB-FB
«
on:
May 03, 2020, 11:37:54 AM »
Oxygenbasic - 0.31 sec
Powerbasic - 3.09 sec
FreeBasic ... - 0.031 sec
Oxygen Basic:
Code: [Select]
'con cat strings in o2
$ filename "strSpeed.exe"
include "rtl32.inc"
Declare Function GetTickCount Lib "kernel32.dll" () As INT
DIM start AS int
DIM endx AS int
DIM strArray[100000] as string
start = GetTickCount()
string s = "test string"
DIM i AS int
FOR i = 1 TO 100000
strArray
= s
NEXT i
endx = GetTickCount()
print "Current value is: " + STR((endx-start)/1000)
Power Basic :
Code: [Select]
#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN () AS LONG
DIM start AS DOUBLE
start = TIMER
DIM s AS STRING : s = "test string"
DIM sArr(100000) AS STRING
DIM i AS LONG
FOR i = 1 TO 100000
sArr(i) = s
NEXT
DIM endx AS DOUBLE
endx = TIMER
MSGBOX "Current value of X% is: " & STR$(endx-start)
END FUNCTION
Free Basic :
Code: [Select]
DIM start AS DOUBLE = timer
DIM sArr(100000) as string
DIM s AS STRING : s = "test string"
FOR i as long = 1 TO 100000
sArr(i) = s
NEXT
DIM endx AS DOUBLE = timer
print endx - start
print LEN(s)
SLEEP
«
Last Edit: May 03, 2020, 09:27:52 PM by Aurel
»
Logged
Brian Alvarez
Guest
Re: Small benchmark...o2-PB-FB
«
Reply #1 on:
May 03, 2020, 03:48:47 PM »
What are your computer specs? My PC is taking 0.016 to complete the task on PowerBASIC... with 1000000 items.
«
Last Edit: May 03, 2020, 05:31:21 PM by Brian Alvarez
»
Logged
Aurel
Guest
Re: Small benchmark...o2-PB-FB
«
Reply #2 on:
May 03, 2020, 09:07:59 PM »
And what is your computer spec?
and what is result for Oxygen ?
FB fix...
DIM start AS DOUBLE = timer
DIM SHARED sArr(100000) as string
DIM s AS STRING : s = "test string"
FOR i as long = 1 TO 100001
sArr(i) = s ' i get error that s need pointer ?
NEXT
DIM endx AS DOUBLE = timer
print endx - start
print LEN(s)
SLEEP
0.031 sec
Logged
Brian Alvarez
Guest
Re: Small benchmark...o2-PB-FB
«
Reply #3 on:
May 04, 2020, 07:08:55 AM »
I am testing on an i7-8700. 24Gb ram.
most of the time the time taken is so small, that it doesnt even register: 0.0000
I wonder why it takes 3 seconds on your system...
By the way... same code compiled for PHP takes: 0.2269
not bad...
Logged
Aurel
Guest
Re: Small benchmark...o2-PB-FB
«
Reply #4 on:
May 04, 2020, 08:07:49 AM »
my is old dual-core for win7...64bit
evan i use on it win7 32 bit most of time , i don't know why PB have the worst result in filling string array
and your computer is too strong for testing
Logged
Brian Alvarez
Guest
Re: Small benchmark...o2-PB-FB
«
Reply #5 on:
May 05, 2020, 08:02:50 AM »
Compiled it for Java... 0.2900 seconds.
Logged
Aurel
Guest
Re: Small benchmark...o2-PB-FB
«
Reply #6 on:
May 05, 2020, 11:50:16 AM »
I have java but i cannot remember when i use it last time ..
yes ..when i try to compile JImage interpreter...source code of this one is nice ,almost looks like basic.
Logged
Print
Pages: [
1
]
« previous
next »
Oxygen Basic
»
Programming
»
Example Code
»
Small benchmark...o2-PB-FB