Benchmark / performance test of Virtual Computer

About the actual programming of the game.

Benchmark / performance test of Virtual Computer

Postby Zardoz » Tue Mar 18, 2014 4:43 pm

Today I end to retractor the benchmark toll of the Virtual Computer. And using it with the new version of the Virtual Computer, I got this :

- The performance isn't worst (good, as we make some stuff more complex, in the search of make more easy to program the virtual computer)
- Mixing different CPU Clock speeds works fine, but having high speed CPUs have the cost of running less Virtual Computer at same time. I got this numbers in my computer :

~ 1000 Virtual Computer running TR3200 @ 0.1 MHz

~ 750 Virtual Computer running TR3200 :
~1% @ 1MHz
~5% @ 0.5MHz
~20% @ 0.2MHz
~74% @ 0.1MHz

It's not bad, but I had the hope of a better ratio of high speed CPUs...
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: Benchmark / performance test of Virtual Computer

Postby croxis » Thu Mar 20, 2014 5:02 pm

I'd like to see how those number stack up with the dcpu. Also, is it possible to distribute a windows/linux benchmark executable (or some easy to compile source code). I would love to benchmark on how many ships my linode vps can support.
croxis
 
Posts: 282
Joined: Tue Aug 13, 2013 1:37 am

Re: Benchmark / performance test of Virtual Computer

Postby Zardoz » Thu Mar 20, 2014 10:00 pm

Meisaka is working on implementing a DCPU-16N on it.

https://github.com/trillek-team/trillek ... ew-version
new-version branch. Should work without problems on VS2012. Ignore a bit the readme file, I don't updated it yet. But you should execute cmake with the parameter to generate a VS2012 solution/project and compile it. The benchmark tool works like this :

Code: Select all
./benchmark rom-files .... [number of CPUS]

Were the romfiles, should be generated with Meisaka's WaveAsm. It can use one or more rom files. Also, optionally can accept the number of CPUS (by default is 1000). Keep in mind that are an appreciable difference if you build in Debug or Release mode.

For example :
Code: Select all
./benchmark ../asm/tr3200/test.ffi ../asm/tr3200/hello.ffi 900
Opening file ../asm/tr3200/test.ffi
Read 680 bytes and stored in ROM
Opening file ../asm/tr3200/hello.ffi
Read 489 bytes and stored in ROM
Runing :
~1% @ 1MHz
~5% @ 0.5MHz
~20% @ 0.2MHz
~74% @ 0.1MHz
Randomizing every CPU!
Executing a random number of cycles from 1 to 255
Running 900 CPUs !
Running 50000 cycles in 46.000000 ms Ttick 0.000920 ms Tclk 0.001000 ms Speed of 108.695652 %
Running 50000 cycles in 46.000000 ms Ttick 0.000920 ms Tclk 0.001000 ms Speed of 108.695652 %
Running 50000 cycles in 45.000000 ms Ttick 0.000900 ms Tclk 0.001000 ms Speed of 111.111111 % 
...

As you can see, my computer is running ~900 CPUs at a speed of ~110%. Ttick is the measure time of a base clock tick , ad Tclk is the expected time of a base clock tick.
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: Benchmark / performance test of Virtual Computer

Postby croxis » Fri Mar 21, 2014 9:29 pm

I'm just using command line cmake. How do I get the benchmark binary to build?
croxis
 
Posts: 282
Joined: Tue Aug 13, 2013 1:37 am

Re: Benchmark / performance test of Virtual Computer

Postby Zardoz » Sat Mar 22, 2014 12:01 am

croxis wrote:I'm just using command line cmake. How do I get the benchmark binary to build?

For Linux , If you are in the directory where you download/clone the repository :
Code: Select all
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make


For VS2012, If you are in the directory where you download/clone the repository :
Code: Select all
cmake -G Visual(do cmake --help to list the generators and get the exact name for VS2012) -DCMAKE_BUILD_TYPE=Release .

Now open the .vsproj or .solution file with VS2012

Also, I'm remembering now, that some bugfixes for VS2012 are in Meisaka's branch for DCPU16-N ...
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: Benchmark / performance test of Virtual Computer

Postby croxis » Sat Mar 22, 2014 3:23 pm

On my headless linode vps I am able to run about 700 cpus at 100% speed. Based on that benchmark alone I expect to be able to run about 300-350 ships and stations, expecting an average of 2 cpus per craft.
Last edited by croxis on Sat Mar 22, 2014 4:27 pm, edited 1 time in total.
croxis
 
Posts: 282
Joined: Tue Aug 13, 2013 1:37 am

Re: Benchmark / performance test of Virtual Computer

Postby Zardoz » Sat Mar 22, 2014 3:48 pm

Fixed ! The CMakeFile for ./tests/ was not being executed if gtests env. variable was not found. I mode the check of it to inside of these CMakeFile so if now not finds gtest, then keeps building benchmark program.
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain


Return to Code

Who is online

Users browsing this forum: No registered users and 1 guest

cron