It is currently March 29th, 2024, 1:41 am

[Performance] Custom Cursors

Get help with installing and using Rainmeter.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Performance] Custom Cursors

Post by Yincognito »

deflore08 wrote: August 6th, 2020, 12:35 amWhen i speak about "skin works slowly", i speak not about CPU load. Adding cursors does not cause load's growth. It is all about delays in skin.
Ah, that clarifies the whole thing. Well, I'm sure you know it's difficult to find out what causes it on a complex skin where you know best what's going on and what things you're not satisfied with (such things might seem ok for me, for example, because I would have no idea what you'd expect to happen or not happen).

My suggestion is to try to replicate the behavior in a simpler skin, just pasting lots of meters there and cursors and see if the problems still persist. My skins are also a bit complex by now so debugging things is more difficult than if they were simpler even for me, but generally if I try to simplify and replicate the issue in a simpler skin to post the problem here, it generally leads to me finding out what the culprit was in the process and giving up posting the message about it as I'm already starting the solving process by then.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
deflore08
Posts: 209
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

Re: [Performance] Custom Cursors

Post by deflore08 »

Well.. One nice man suggested to attach a video here, so i will. If someone really interested to take a look for the problem, the following videos might help with understanding what happens and what i am talking about.

In the both videos Update=100. Don't look to my temps and throttling, i lost one fan in my laptop and he just trying to survive. Skin causes micro-freezes on each update and it is "ok" for now, i understand why - because ~700 dynamed meters and measures with quick update rate and it still needs to be optimized somehow.

But as you can see in the both videos, performance with and without custom cursors are very different. The code i lead before explains which approach was used to config cursors in this skin. There is about 20-30 (i changed the value while test it) meters with cursors in the skin. Only FADE effects uses ActionTimer, so color changing doesn't. And 90% of meters used for demonstration does not use custom cursors.

Well.. Caution with sound, there is music.

The first. And second ones.
Image * Image * Image * Image
User avatar
deflore08
Posts: 209
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

Re: [Performance] Custom Cursors

Post by deflore08 »

I made some tests with different types and sizes of a cursors. If i use *.cur files for cursors - it is okay, influence on performance are minimal. But with *.ani cursors it leads you right to the hell. Now i talk about 80+ "cursored" meters. Ironically, weight of cursors is not important. Some *.ani cursors that i have used has less weight than *.cur files.

In addition, it not depends on Update frequency. No matter how much i set it - 100 or 2000, *.ani cursors causes work everything slow and it works same in the both cases. As example - Fade effect based on action timer.
Image * Image * Image * Image
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Performance] Custom Cursors

Post by Yincognito »

deflore08 wrote: August 6th, 2020, 3:57 pm I made some tests with different types and sizes of a cursors. If i use *.cur files for cursors - it is okay, influence on performance are minimal. But with *.ani cursors it leads you right to the hell. Now i talk about 80+ "cursored" meters. Ironically, weight of cursors is not important. Some *.ani cursors that i have used has less weight than *.cur files.

In addition, it not depends on Update frequency. No matter how much i set it - 100 or 2000, *.ani cursors causes work everything slow and it works same in the both cases. As example - Fade effect based on action timer.
That's great. So this means using .cur cursors doesn't cause the issues you experienced, right? At least not at the level they were while using .ani cursors, correct? If so, all you need to do is find a tool to convert those .ani cursors into .cur cursors (if .cur files support animation, that is) and problem solved, I suppose, isn't it?

EDIT: Just checked it out, it appears that the .CUR format is not so friendly to animations. I saw that you can create your own cursors with RealWorld Cursor Editor and convert what you can either here or here. In any case, since the .ANI seems to be the problem, one possibility is that it's because of the animations in the .ANI files, like we talked about earlier (I have no idea why the issue is present even when the meter doesn't have an animated cursor over it though). What you can do is use an .ANI editor to reduce the number of frames in the .ANI. I just opened up a .GIF resulted from a conversion from .ANI in Photoshop and it appears to have 20 frames - that's probably a bit too much. Some movements can even be reduced to just 2 frames and that should considerably alleviate the problem, if it's indeed about the animations in the .ANI that overworking your already animated and complex skin. If it's not and it's just the .ANI format or files that cause this in your skin, just replace them with .CUR cursors and be done with it. Animation is fine and dandy as long as it doesn't prevent the skin from behaving like it should. Later on after you seriously optimize your code (e.g. a "normal" update rate since you perform the animations with ActionTimer and mouse actions don't need fast update rates anyway, a reduced number of meters, etc.), you might try to reintroduce animated cursors and see if it breaks things again - my impression is that on a properly optimized skin it won't happen.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
deflore08
Posts: 209
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

Re: [Performance] Custom Cursors

Post by deflore08 »

Yep, Yin. You're absolutely right. Optimization is all of ours. :) For now i just will replace them or even reject this idea, till performance will allow to use it. But one thing that i actually see - there is a real issue (or a feature?) in this mechanism. I quess, overloaded skin just demonstrated this issue while a small skins can't because they have a large supply of pc-resources, but sure, for now it is only assumption. Later, i will do more test with different behaviours on clean skins to check it out, what concrete causes it to work bad, so as not to slender Rainmeter (am i said it correctly?).

Thanks for your time, efforts and stuff. :)
Image * Image * Image * Image
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Performance] Custom Cursors

Post by Yincognito »

deflore08 wrote: August 6th, 2020, 9:36 pm Yep, Yin. You're absolutely right. Optimization is all of ours. :) For now i just will replace them or even reject this idea, till performance will allow to use it. But one thing that i actually see - there is a real issue (or a feature?) in this mechanism. I quess, overloaded skin just demonstrated this issue while a small skins can't because they have a large supply of pc-resources, but sure, for now it is only assumption. Later, i will do more test with different behaviours on clean skins to check it out, what concrete causes it to work bad, so as not to slender Rainmeter (am i said it correctly?).

Thanks for your time, efforts and stuff. :)
Yeah, it appears so, but then, on overloaded skins, pretty much everything is an issue, if you know what I mean. I'm not even sure it's a Rainmeter issue, since it probably uses Windows' own system of displaying cursors (i.e. I don't think Rainmeter draws the custom cursors on its own), but maybe the way it caches the custom cursors could be better, especially considering the fact that it happens even on meters that don't have custom cursors assigned to them...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
deflore08
Posts: 209
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

Re: [Performance] Custom Cursors

Post by deflore08 »

For sure it's should be windows sub-system. Need more tests on this, i will back here later..
Image * Image * Image * Image