Demo: Green Dragon

Articles with the tag: Performance Profiling

Framework: checking memory leaks with Valgrind

Profiling with Valgrind memcheck and gprof to check for memory leaks and performance problems. Could things be sped up by not using so much C++ standard library things (which I used copiously for educational purposes, instead of clobbering everything together in C)? One mustn't assume so, sez Stroustrup - testing is needed.

Loading could be drastically improved by saving JSON and COLLADA model formats in a form suitable for my game environment. The vertex indexer currently involves a triple-nested for-loop!

[29/06/14 23:13]

All the valgrind warnings are gone apart from one about the OpenGL library. That can't be my fault, right?

Read More »

Performance profiling

CPU is taking up 100%. Profiling.

[28/03/14 15:42]

Used gprof to profile function call times.

The game loop runs at a maximum 60 hz to prevent overloading the CPU, but it still checks whether or not the time is correct as fast as it can, as shown by the code:

while (true)
    new_time = glfwGetTime();

    if (new_time - last_time >= (1.0 / 60.0))
        // Update, Render...

The checking and conditional for the correct time must be integrated in the 60 hz loop.

Bool flags might be a less taxing option.

Using bool flag method:
Function time: 190 ms or 30 ms...
Using old method:
1.5 seconds.

Well it's better, but it cuts the FPS by a tiny amount which might lead to syncing problems in the future.

[28/03/14 16:09]

Changing conditional's predicate (1.0 / 60.0) to a pre-calculated variable shows that it was ...

Read More »

Page 1 / 1