SFML community forums

Help => General => Topic started by: Qix on October 24, 2012, 05:10:21 am

Title: Strange bottleneck
Post by: Qix on October 24, 2012, 05:10:21 am
Running my program is fine for a while; however, over a period of about 4-5 minutes it slows down almost to a halt and maxes out the CPU.

Did a little profiling and found this particular callstack to be the culprit:
(http://gyazo.com/d58be101bc29368616301b7e0ababebc.png?1351048076)

I'm not using the joystick at all. Why is this slowing down the program? It'd be easy if it was showing where my code was involved in this particular stack but it doesn't.

Any help?
Title: Re: Strange bottleneck
Post by: Qix on October 24, 2012, 05:14:34 am
Ah it seems the push/pop GL States call is doing this. Does that make any sense?

EDIT: Nope, nevermind. Still getting the bottleneck.
Title: Re: Strange bottleneck
Post by: Laurent on October 24, 2012, 08:09:46 am
Code? Version of SFML?
Title: Re: Strange bottleneck
Post by: Qix on October 24, 2012, 09:46:23 am
I don't know which part of the code to post. :x the call stack shows no relevant part of my own code.

SFML 2.0, latest.
Title: Re: Strange bottleneck
Post by: Laurent on October 24, 2012, 09:48:43 am
Quote
I don't know which part of the code to post. :x the call stack shows no relevant part of my own code.
Then the best thing to do now is to extract a complete and minimal code that reproduces the problem. Remove anything that doesn't make the problem disappear.
Title: Re: Strange bottleneck
Post by: Qix on October 25, 2012, 11:12:25 am
That will take me a while... I have almost 100 source files with hundreds of lines each.


I'll figure out where it's bottling up and I'll reply here.
Title: Re: Strange bottleneck
Post by: Zephilinox on October 25, 2012, 06:45:53 pm
Is this not related? http://en.sfml-dev.org/forums/index.php?topic=7907
Title: Re: Strange bottleneck
Post by: Laurent on October 25, 2012, 07:55:26 pm
Quote
Is this not related? http://en.sfml-dev.org/forums/index.php?topic=7907
This bug has been fixed.
Title: Re: Strange bottleneck
Post by: Qix on October 26, 2012, 11:46:56 am
Quote
Is this not related? http://en.sfml-dev.org/forums/index.php?topic=7907
This bug has been fixed.

Yea, it doesn't appear to be the same bug.

Laurent, is there a way to just disable SFML from using any sort of joystick functionality? I mean, in the source; this particular application wouldn't be using the joystick at all. It may not fix the problem, but it's worth a try.
Title: Re: Strange bottleneck
Post by: Laurent on October 26, 2012, 11:48:22 am
You can comment out the call to Joystick::update (should be hidden under Window::pollEvent).
Title: Re: Strange bottleneck
Post by: Qix on October 28, 2012, 02:51:04 am
You can comment out the call to Joystick::update (should be hidden under Window::pollEvent).

Oh cool, I will do that!