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

Author Topic: Strange window.pollEvent(event) performance problem - Win 8.1  (Read 2304 times)

0 Members and 1 Guest are viewing this topic.

HeliumPL

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Strange window.pollEvent(event) performance problem - Win 8.1
« on: November 17, 2013, 05:27:16 pm »
Hi!

Sometimes when I run my game it freezes for about ~200 ms every ~600 ms. Deleting
while (window.pollEvent(event))
fixes the problem. The problem isn't present everytime. Sometimes when I run my game it works normal. If the problem appears I usually run the game(or any other SFML application!) as administrator and this fixes the problem.

My system is Windows 8.1 Pro and I use Visual Studio 2013 for Windows Desktop.

Sorry for bad english!  ;D

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Strange window.pollEvent(event) performance problem - Win 8.1
« Reply #1 on: November 17, 2013, 05:31:34 pm »
Do you have a gamepad or joystick plugged into your PC?

You could profile the application to see where it wastes its time. My guess from past experience is that it's hanging in the joystick code... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

HeliumPL

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Strange window.pollEvent(event) performance problem - Win 8.1
« Reply #2 on: November 17, 2013, 06:20:08 pm »
I have no gamepad/joystick and my game doesn't support it ;)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Strange window.pollEvent(event) performance problem - Win 8.1
« Reply #3 on: November 17, 2013, 07:06:04 pm »
SFML will still be looking for any connected devices. Anyways you should just profile the application and see where the time is being wasted. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 878
    • View Profile
Re: Strange window.pollEvent(event) performance problem - Win 8.1
« Reply #4 on: November 17, 2013, 10:26:11 pm »
Maybe you're doing something more weird inside the loop or when handling events? Show some more code or a minimal example? Running my SFML stuff just fine under Windows 8.1 here without any lags or similar issues.

HeliumPL

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Strange window.pollEvent(event) performance problem - Win 8.1
« Reply #5 on: November 19, 2013, 06:14:52 pm »
No, I don't. Even if I leave the loop empty, the problem occurs. If I delete it - it's fixed.

 

anything