1. Performance Benchmarks

I ran across these benchmark tests comparing some basic compilers.Do these test have any validity for comparing performance?

The code was the same for the three clones. To check speed in >>CPU bound:

'************************************* 
Dim X As Double 
Dim Y As Double 
Dim intCounter As Integer 
Dim sStartTime As Integer 
Dim sEndTime As Integer 
 
sStartTime = Time$ 
Print sStartTime 
Y = .5 
For intCounter = 1 To 50000000 'Main loop 
Y = Y / 1.1234 
Y = Y * 1.1234 
X = acos(Y) 
X = asin(Y) 
X = tan(Y) 
X = cos(Y) 
X = exp(Y) 
X = log(Y) 
X = sin(Y) 
X = sqr(Y) 
X = tan(Y) 
Next intCounter 
sEndTime = Time$ 
Print sEnd 
Sleep 'Wait 
'************************************* 

To check speed in >>I/O bound:

'************************************* 
Dim intCurr As Integer 
Dim intFF As Integer 
Dim strStartTime As String 
Dim strEndTime As String 
 
strStartTime = TIME$ 
Print strStartTime 
 
intFF = FREEFILE 'First free file handle 
 
Open "F:\Text.Test" For Output As #intFF 
FOR intCurr = 1 TO 25000000 
PUT #intFF,, STR(intCurr) 
NEXT 
Close #intFF 
strEndTime = TIME$ 
Print strEndTime 
Sleep 'Wait 
'************************************* 

The results to my slow Compaq Presario laptop (512mb ram, Pentium 1,7mhz) was:

>>CPU 
HotBasic (demo licence): 49sec Exe size: 4.608bytes 
PureBasic (demo licence): 1min 31sec Exe size: 6.144bytes 
FreeBasic: 57sec Exe size: 21.504bytes 
RealBasic (demo licence): 2min 27sec Exe size: 1.584.603bytes 
 
>>IO 
HotBasic (demo licence): 1min 25sec Exe size: 6.656bytes 
PureBasic (demo licence): 1min 00sec Exe size: 12.800bytes 
FreeBasic: 39sec!!! Exe size: 29.184bytes 
RealBasic (demo licence): 5min 11sec Exe size: 1.582.817bytes 

[edit: added formatting. matt]

new topic     » topic index » view message » categorize

2. Re: Performance Benchmarks

Here are the Euphoria (v4) equivalents ...

-- CPU *************************************  
include std/math.e 
atom X 
atom Y 
atom sStartTime 
atom sEndTime 
  
sStartTime = time() 
printf(1,"%g\n", sStartTime ) 
Y = .5  
  for intCounter = 1 to 50000000 do --Main loop  
  Y = Y / 1.1234  
  Y = Y * 1.1234  
  X = arccos(Y)  
  X = arcsin(Y)  
  X = tan(Y)  
  X = cos(Y)  
  X = exp(Y)  
  X = log(Y)  
  X = sin(Y)  
  X = power(Y, 0.5)  
  X = tan(Y)  
end for 
sEndTime = time() 
printf(1,"%g\n", sEndTime ) 
printf(1,"%g\n", sEndTime - sStartTime ) 
-- I/O  *************************************  
integer intFF 
atom sStartTime 
atom sEndTime 
  
sStartTime = time() 
printf(1,"%g\n", sStartTime ) 
intFF = open("Text.Test", "w") 
for intCurr = 1 to 25000000 do 
  printf(intFF,"%d\n",intCurr) 
end for 
close(intFF) 
sEndTime = time() 
printf(1,"%g\n", sEndTime ) 
printf(1,"%g\n", sEndTime - sStartTime ) 
new topic     » goto parent     » topic index » view message » categorize

3. Re: Performance Benchmarks

DerekParnell said...

Here are the Euphoria (v4) equivalents ...

-- CPU *************************************  

FYI, RDS 4 did that in 224s; replacing "include std/math.e" with "include misc.e" and "X = exp(Y)" with "X = power(2.7182818284590452,Y)", 2.4 did it in 126s.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu