xsharp.eu • Performance comparison X# runtime vs Vulcan runtime
Page 1 of 3

Performance comparison X# runtime vs Vulcan runtime

Posted: Fri Jun 15, 2018 9:13 am
by Otto
Has anyone already any benchmarks? Just curious...

Performance comparison X# runtime vs Vulcan runtime

Posted: Fri Jun 15, 2018 9:18 am
by wriedmann
Hi Otto,

I have it on my todo list.

I'm planning to compare array creation, size change, sort, find.

Do you have other ideas?

Wolfgang

Performance comparison X# runtime vs Vulcan runtime

Posted: Fri Jun 15, 2018 12:17 pm
by Otto
Typical VO/Vulcan language things, using the runtime. But maybe it isn't separable from the compiler sometimes I guess.

* late bound calls
* use of symbols/atoms
* date manipulation

Performance comparison X# runtime vs Vulcan runtime

Posted: Fri Jun 15, 2018 1:23 pm
by wriedmann
Hi Otto,

I will try to put together something and release it with the sources so you or someone other can add more tests.

Wolfgang

Performance comparison X# runtime vs Vulcan runtime

Posted: Fri Jun 15, 2018 2:32 pm
by Chris
Guys,

Just a quick heads up, we did write the runtime with performance in mind, but have not done much optimization on the code yet, first important stuff is to just implement all the required functionality.

This means that in some cases the X# runtime will be faster, but I am sure that in other cases it will be slower, or much slower. But that's just temporarily, it will improve a lot in the coming weeks.

We will also run speed tests, but having said that, any test you do you guys yourselves is greatly appreciated, less work for us to find out in which areas we need to focus regarding speed optimization!

Chris

Performance comparison X# runtime vs Vulcan runtime

Posted: Sat Jun 16, 2018 5:37 pm
by wriedmann
Hi,

constructing arrays the X# runtime is much, much faster than the Vulcan runtime.

My test code took 6,49 seconds with the Vulcan runtime and 1,67 seconds with the X# runtime.

This was my sample:

Code: Select all

function CheckArrayPerformance() as void
local aArray as array
local aDetail as array
local nI as dword
local nJ as dword
local nLen as dword
local nStart as float
	        
aArray := {}
nLen := 5000
nStart := Seconds()
	
for nI := 1 upto nLen
  aDetail := ArrayNew( int( nLen ) )
    for nJ := 1 upto nLen
      aDetail[nJ]			:= nJ * nI 
    next
    AAdd( aArray, aDetail )
next
	
Console.WriteLine( "Filling the bidimensional test array with " + NTrim( nLen ) + " elements each took " + NTrim( Seconds() - nStart ) + " seconds" )
	
return
Running the test with 10.000 elements failed with both runtimes with a out of memory exception.

Repeating the test with the X# runtime in AnyCPU mode it was slower: 2,23 seconds, but it was able to finish the test also with 10.000 elements.

Very good work!

Wolfgang

Performance comparison X# runtime vs Vulcan runtime

Posted: Mon Jun 18, 2018 3:45 am
by mhsabado
Hi,
Maybe OT. Running this test under Harbour 64-bit:

5,000 = 1.6s
10,000 = 6.94s
20,000 = 30.76s

Regards,
Mario

Performance comparison X# runtime vs Vulcan runtime

Posted: Mon Jun 18, 2018 7:00 am
by FFF
Got exactly the same for 5k as you, while 10k needed 9,4sec.
@Chris: there's a trap in XIDE: created a new X# core sample, added the x#runtime references, (Core&VO). Platform auto-changed to x86. clicking on anyCpu (or x64) works, compiles and runs, but silently switches back to x86!

Karl

Performance comparison X# runtime vs Vulcan runtime

Posted: Mon Jun 18, 2018 11:08 am
by wriedmann
I have tried that now with VO 2.8.

With 5.000 elements and the addition of SetMaxDynSize( 0x8000000 ) it took very long until it terminated with a "dynamic memory low" error.
With 2.500 elements it took 27,2 seconds.

My conclusion is that the memory managment in .NET is much, much better in VO, and large VO applications with heavy array use may perform better in X# than in Visual Objects.

Another thing to try will be the macro compiler using AScan().. There I would expect VO to be faster.

Of course the values of Harbour are not off-topic, but they are interesting to see what a machine code program can do better than a .NET based software.

Wolfgang

Performance comparison X# runtime vs Vulcan runtime

Posted: Mon Jun 18, 2018 11:25 am
by lumberjack
Hi Wolfgang,

AAdd() is quite slow. How does it compare when you use the code as I changed (in blue).

Johan
wriedmann wrote: This was my sample:

Code: Select all

function CheckArrayPerformance() as void
local aArray as array
local aDetail as array
local nI as dword
local nJ as dword
local nLen as dword
local nStart as float

nLen := 5000
nStart := Seconds()
[color=blue]aArray := ArrayNew((int)nLen)[/color]
	
for nI := 1 upto nLen
  aDetail := ArrayNew( int( nLen ) )
    for nJ := 1 upto nLen
      aDetail[nJ]			:= nJ * nI 
    next
    [color=blue]aArray[nI] := aDetail[/color]
next
	
Console.WriteLine( "Filling the bidimensional test array with " + NTrim( nLen ) + " elements each took " + NTrim( Seconds() - nStart ) + " seconds" )
	
return