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

Author Topic: joystick issue on windows  (Read 5150 times)

0 Members and 1 Guest are viewing this topic.

mkalex777

  • Full Member
  • ***
  • Posts: 206
    • View Profile
joystick issue on windows
« on: September 26, 2015, 09:34:16 pm »
I'm not using joystick at all, but my SFML app reads registry values related to joystick.
There a lot of registry requests every second.
In Process Monitor it looks like spamming.
How can I disable it to avoid unwanted access to the disk?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: joystick issue on windows
« Reply #1 on: September 27, 2015, 10:07:38 am »
You currently can't. But is it really an issue? Are you experiencing significant slowdowns? If not, just don't bother with it.  ;)
SFML / OS X developer

mkalex777

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: joystick issue on windows
« Reply #2 on: September 28, 2015, 09:33:21 pm »
yes, I got high lags, but I analysed it more deep and it seems that the root of cause is text rendering.
I don't know what is happens. I render for about 500 strings per frame, it's size is not constant and modified continuously. Sometimes, probably when there are too many changes, my app freezed for 0.5-3 second.
I profiled the code and it happens on text rendering. If I disabling text rendering, all works ok.

Firstly I monitored app activity with sys internals process monitor and take into account that SFML very often request registry, so my first impression is that it's root of cause. But now I see that there is something strange happens with graphics...
« Last Edit: September 28, 2015, 09:36:33 pm by mkalex777 »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: joystick issue on windows
« Reply #3 on: September 28, 2015, 10:16:25 pm »
I render for about 500 strings per frame, it's size is not constant and modified continuously. Sometimes, probably when there are too many changes, my app freezed for 0.5-3 second.
Do you mean 500 strings in one (or a few) sf::Text objects or 500 sf::Text objects? The latter is 500 draw calls.
What changes are you applying that freeze the app.?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

mkalex777

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: joystick issue on windows
« Reply #4 on: September 29, 2015, 05:24:35 am »
I render for about 500 strings per frame, it's size is not constant and modified continuously. Sometimes, probably when there are too many changes, my app freezed for 0.5-3 second.
Do you mean 500 strings in one (or a few) sf::Text objects or 500 sf::Text objects? The latter is 500 draw calls.
What changes are you applying that freeze the app.?

I tried different ways, there is no signigicant difference between single instance and separate instance per each text. But separate instance consumes a lot of memory, so I'm using just several Text instances - one per each font. I don't know exactly what change causes freeze, but it seems that it appears at the moment when 10-20 new texts added on the rendering scene and one existing text significantly decreased in size.
I'm using text to render name of the game object. It's size depends on the object size. And freeze happens when the object splits into several smaller parts (up to 8-16). Probably it something related to internal optimization. When there are a lot of changes in text count and it's sizes, internal code probably attempts to rewrite some graphics memory or rebuild some internal cache...
I cannot do anything at the time of these freezes, sometimes it prevent movement of mouse cursor in the system and stops to update soundcard buffer for 1-2 sec.

I just read topic about text render performance in sfml and it shows that switching between shapes and texts inside loop may cause increase of render time, so I will try to split text rendering code into separate loop.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: joystick issue on windows
« Reply #5 on: September 29, 2015, 07:04:57 am »
Firstly I monitored app activity with sys internals process monitor and take into account that SFML very often request registry, so my first impression is that it's root of cause. But now I see that there is something strange happens with graphics...
Use a profiler, not a system call monitor.