Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Frame rate drop on mouse movement -> fix attemps  (Read 3031 times)

0 Members and 2 Guests are viewing this topic.

Adinimys

  • Newbie
  • *
  • Posts: 2
    • View Profile
Frame rate drop on mouse movement -> fix attemps
« on: September 07, 2015, 12:10:05 am »
I first posted on Tig Source for advices, describing my issue : http://forums.tigsource.com/index.php?topic=50222.0

So it's the same problem as described in :
http://en.sfml-dev.org/forums/index.php?topic=4378.0
http://en.sfml-dev.org/forums/index.php?topic=6079.0

So I tried a quick hack (for linux only for now) by removing the handling of the joystick and what I believe is for touchscreen (SensorEvent) . I commented line 118-119 and 131-132 in WindowImpl.cpp.
Then as I was getting the position of the mouse each frame I removed the handling of mouse movement in the events by commenting lines 2187 to 2199 in WindowImplX11.cpp

Now when I run my game that previously add slowdown to 1fps (it's running on a 1GHz CPU) when the mouse moved I'm getting a steady 850+fps.
The only issue is that I have in std::out a long list (I'll copy-paste it if needed) and it warns about "Unhandled event type: 6"
And it tells "Report this to the SFML maintainers if possible"

When I'll have time I'll test the respective impact of my three removals (joystick, sensor and mouse movement) to see what happens.

What do you think of this solution ? And what about the error messages, can I safely ignore them ?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Frame rate drop on mouse movement -> fix attemps
« Reply #1 on: September 07, 2015, 01:47:31 am »
Build the application without any modifications to SFML or your own code with profiling enabled (-pg) and run it. Move the mouse around for a minute and keep the application running at 1 FPS (this is to get a good sample size). After that is done, run gprof on the profiling data and provide the text output here.

As for the warning, that is what happens when events go unhandled. I think it should be obvious why you are seeing it after your modifications.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Adinimys

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Frame rate drop on mouse movement -> fix attemps
« Reply #2 on: September 07, 2015, 01:48:59 pm »
So, while I was testing following your guidelines I had issues recreating my frame drop. Then I realized that I was comparing the compiled SFML 2.3 to the pre-compiled package of ubuntu Trusty which is... 2.1.
I tested with the source code of the 2.1 and then the issue is back (but not in 2.2) so it's an issue that has already been solved...

Quote
As for the warning, that is what happens when events go unhandled. I think it should be obvious why you are seeing it after your modifications.

Yes sure, it's obvious ^^ I was just trying to know if there was other part of the system that are relaying on what happens in the code that prints the warning because I had trouble understanding it  ;D. But I guess that it's just a warning and I can ignore it if there is no other issue with inputs.

So in the end... I think I just found an already known bug  ::), nothing new there and I'll now go with building the 2.3 myself instead of using the 2.1 package of Ubuntu

mkalex777

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Frame rate drop on mouse movement -> fix attemps
« Reply #3 on: September 30, 2015, 03:52:09 am »
is there any way to disable the joystick support?
Actually I dont needed it in my project. I just don't like that SFML access joystick related registry records very often even if I don't use it at all...
Also I read the topic about fps dropdown due to joystick update. So I think it should definitely allows to be disabled...
« Last Edit: September 30, 2015, 05:13:41 am by mkalex777 »