Benchmark for Monkey

Monkey Archive Forums/Monkey Projects/Benchmark for Monkey

Duke87(Posted 2013) [#1]
Hi Guys, my name is Stephan Duckerschein, I'm from Germany and new to the Community :D.
Well I'm not a professionell programmer, just doing as a Hobby.
But in the Future I want to understand a little bit more the theoretical-stuff, therefor i started reading books esp. from "GalileoComputing" and some OOP-Tutorials
(Just coded some Games Like: Quizz, Bomberman, Pong, Tower Defense in BlitzBasic and BlitzMax).

Yesterday I had a little idea about making kind of benchmark for the Monkey-Community. So i just started programming (with no planning).

My Aim is not a benchmark for the power of PC-Processors. I want to compare the speed of different targets by using the same Code.
(for example: how long does it need to Add/multiply/divide/substract numbers within a For-loop), display primitives and update their movement/shape). Maybe it will help you to decide when to use List/Maps ..., locals/globals, Classes, and so on.

I have coded 8 Tests yet
1. uses global declared variables
2. uses locals ...
3. uses functions with global var. as params
4. uses functions with local declared vars.
5. uses a static-class with only static variables/functions
6. uses an object with member-variables/methods
7. creates 1000 primitive-canvas objects (Line,Rect,Circle)

ToDo:
8. using real images with scaling, alphablending ...
9. Call a Homepage and download Data
10. writing Files
11. Compare using Lists/Maps/Arrays ...
12. Compare If/Endif, Select-Case

long term Aim:
Using the Challenger GUI for Displaying the Results.
Storeing the Results onto a Webserver with the System-Specs.

each Test runs for 1 second and counts, how many updates will be called. (therefor i set the UpdateRate to 20000
(Test#7 runs for 15 seconds, so u can se something on the screen).

I have to admit, that my Code is very nasty (some parts in german, some parts in english, no destructors included and so on).
I want to recode it and dress up the visual disply.

For now i have some questions.
1. How can i Post my Code, so u can scroll it within a window?
(For now, u only would need to copy&paste it (now extern files needed)

2.
Because i dont know how much it will affect to the speed by putting all codes into a kind of "Benchmark-Class", i just wrote it kind of procedural-programming style. So do u know how i could do so, without slowing it?

3. Do I have some principle/logical errors in my Code?
Especially Storeing the objects in Lists.

4. Do you have any Idea or needs to be benchmarked for your projects?


My Results as Far: (Monkey V70e Debug-Mode)

Test 1 (globals): 44,120 (Android) ; 6,350,704 (HTML5) ; 10,059,733 (GLFW)
Test 2 (locals): like Test 1 (+/-2%)
Test 3 (function-calls): 21,628 (Android) ; 4,510,712 (HTML5) ; 2,948,847 !!?? (GLFW) << i thought GLFW would be faster than HTML5

Test 4 : like Test 3 (+/-0.5%)

Test 5 (Static-Class): 14,914 (Android) ; 3,167,620 (HTML5) ; 1,852,700 (GLFW)
Test 6 (uses an global object) (roughly about 1/3 of Test 5)

Test 7: 3,300 (Android) ; 7,300 (HTML5) ; 24,378 (GLFW)
rendered screens within 15 seconds (1000 primitives)

Android means using an Emulator, was to lazy to setup the USB-Drivers, will coming soon^^.

I'm recoding right now, but i'm not ready yet, so i have to show u the "messy" code (Just wanted to have fast results). End of the next week i try to have included Challenger-GUI for display results, using more/better comments (english only), and some descriptions to the Tests. In generally i will try to code in "english-only" ^^ (but i only read german books yet, so i'm not good in giving english names)

I hope you understand the priciples of this project, my english isn't the best.
Have a nice day, Stephan.

//CODE:

Edit#1:
I'm sorry for that Code, in real i used tabs to format the Code, but its deleted here :(

Edit2: Forgot to tell, that u will have to wait about 20seconds until u see any results, or press "d" for "Show-Results-Debug" ...


ziggy(Posted 2013) [#2]
You may place code between [ code ] and [ /code ] (remove spaces between braces and word "code") That's the way to tell this site to keep the code formatting.
If code is too large, you may use [ codebox ] and [ /codebox ].
See all forum bbcodes here.
Are you results based on debug mode?


Duke87(Posted 2013) [#3]
Thank you for your fast reply.

Yes i used the Debug-Mode.