Profiling Glfw

Monkey Targets Forums/Desktop/Profiling Glfw

frank(Posted 2013) [#1]
I got Monkey to work on my ARM chromebook, but, while most demos are fast under Glfw, some demos, like Monkenstein are just unusable slow. Like not even 1 fps. How can I profile/find the issue here?


AdamRedwoods(Posted 2013) [#2]
is it slow under HTML5 as well? i usually try the Chrome profiler for javascript first for general profiling.

but for glfw specifically, i use "very sleepy"
http://www.codersnotes.com/sleepy
you may need to modify the VC++ project file to allow debug output to get detailed info. i think it's off by default.


frank(Posted 2013) [#3]
No HTML5 is fast; faster than Glfw on my other laptop actually... Which I also find slightly disturbing :)

Only Glfw and only with a few of the bananas.

Sleepy looks nice, but we're talking about a Ubuntu (Chrome) ARM laptop ; no Windows, no VC++ :)

I'll try gprof to try to find what's going on.


AdamRedwoods(Posted 2013) [#4]
http://manpages.ubuntu.com/manpages/lucid/man1/perf.1.html
http://oprofile.sourceforge.net/about/


slenkar(Posted 2013) [#5]
what graphics card does the chromebook have?
maybe the chrome OS doesnt have the right drivers?

Have you tried any other games made with other languages? (with 3d rendering)


frank(Posted 2013) [#6]
The Chrome book automatically has the right drivers with Ubuntu, because Ubuntu uses the Linux Google drivers which are included with ChromeOS. And they work very well as all WebGL/OpenGL runs really well/fast for such low spec; I have many open source games running well as well as emulators which use OpenGL for acceleration.

I did come closer by trying to figure out what is wrong, because something is very wrong :)

When compiling the binary with profiling info or while trying to compile for release, so not debug, it seems all to boils down to software using GrabImage; they run very slow or, when compiling for Release, seg with a memory violation:

Without gbd:

Monkey Runtime Error : Memory access violation
/home/tycho/MonkeyPro75d/modules/mojo/graphics.monkey<105>
/home/tycho/MonkeyPro75d/bananas/skn3/monkenstein/monkenstein.monkey<113>
/home/tycho/MonkeyPro75d/modules/mojo/app.monkey<43>

{{~~/home/tycho/MonkeyPro75d/modules/mojo/graphics.monkey<105>~~}}
+GameDelegate.StartGame;/home/tycho/MonkeyPro75d/modules/mojo/app.monkey<43>
Self:GameDelegate=@1c99ca0
+myApp.OnCreate;/home/tycho/MonkeyPro75d/bananas/skn3/monkenstein/monkenstein.monkey<113>
Self:myApp=@1c99150
levelData:String="7777777777772222244444447000000000070000040000047000000000074444440000047000221200000000000000047000..."
index:Int=0
+Image.GrabImage;/home/tycho/MonkeyPro75d/modules/mojo/graphics.monkey<105>
Self:Image=@(nil)
x:Int=0
y:Int=0
width:Int=1
height:Int=64
frames:Int=64
flags:Int=0

With gdb:

[New Thread 0x7549a450 (LWP 13260)]
[Thread 0x7549a450 (LWP 13260) exited]
[New Thread 0x7549a450 (LWP 13261)]
[New Thread 0x70aff450 (LWP 13262)]

Program received signal SIGSEGV, Segmentation fault.
0x0004435e in Array<c_Frame*>::Length() const ()

and stacktrace;

#0 0x0004435e in Array<c_Frame*>::Length() const ()
#1 0x00038392 in c_Image::p_GrabImage(int, int, int, int, int, int) ()
#2 0x00032408 in c_myApp::p_OnCreate() ()
#3 0x000356a0 in c_GameDelegate::StartGame() ()
#4 0x0002c1f8 in BBGame::StartGame() ()
#5 0x0002ddbc in BBGlfwGame::Run() ()
#6 0x0002e054 in BBMonkeyGame::Main(int, char const**) ()
#7 0x00040506 in main ()

To me this makes no sense, but what can I do to help Monkey? :)

(Edit: this is a clean 75d install so there is nothing changed in Monkenstein)