It is currently March 28th, 2024, 11:18 am

Dynamic UpdateDivider!?

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Dynamic UpdateDivider!?

Post by Yincognito »

death.crafter wrote: August 25th, 2021, 3:56 pm Me who has kept the default 16 in my vis and still get decent perfomance

tenor (1).gif

Actually it's about the Plugin used. I use Audio Analyzer. It gives decent performance over AudioLevel. Also, there is the fact that my vis is in whole one shape. So it doesn't eat much resources on redraw that's all.
Yeah, there are several (cumulative) factors involved in the performance:
- the plugin probably, as you said
- the size (possibly even type) of meters / skin and the measures complexity from a mathematical POV
- the resizing applied to meters like images
- the other CPU intensive operations in your system (including other skins AND external programs, not just Rainmeter)
- the update rate of each Rainmeter skin and its meters, not just the current one
- the number of AudioLevel parent measures, for visualizers (I, for example, have 2, one for Input and one for Output, since AudioLevel doesn't support dynamically switching the parent measure options like Port or ID)
- probably other factors as well
I know this because I constantly push Rainmeter to the limit and I'm very strict when it comes to performance / efficiency, LOL. That's why I just can't understand the idea of being ok with disregarding code optimization to improve performance, just because it's tolerable on higher end or own computers. That just feels wrong and a waste for me. If I can get an item for 5 bucks by choosing the right store nearby, I'm not gonna spend 50 on it even if I had millions - it's just plain common sense, not greed or avarice.
JRaynor
Posts: 5
Joined: August 25th, 2021, 3:51 am

Re: Dynamic UpdateDivider!?

Post by JRaynor »

death.crafter wrote: August 25th, 2021, 7:30 am If you are trying to make a visualizer, UpdateDivider=50 is kinda too large.

And this part:

Code: Select all

IfTrueAction=[!SetVariable AudioUD  "50"] [!Redraw]
IfFalseAction=[!SetVariable AudioUD "-1"] [!Redraw]
should be like this:

Code: Select all

IfTrueAction=[!SetVariable AudioUD  "50"][!Update]
IfFalseAction=[!SetVariable AudioUD "-1"][!Update]
The !Redraw bang only reDRAWs a skin. It doesn't update the measures or meters, which is needed to reflect the changes.

Also you are using the same UpdateDivider in the measure where the if conditions are present([MeasureAudio]). So if updatedivider is set to -1, it will never update again, that means the value won't change and you're stucj with UpdateDivider=-1 eternally.

I don't know about the efficiency tho. The result you'd get wouldn't be pleasant. But then again each to his own leaf.
Thanks for your feedback.

You are right about using UpdateDivider=-1.
After some tests I started using something like 400 or more...
But I'm still not able to reduce the CPU usage as I wanted... I'll do more tests....
JRaynor
Posts: 5
Joined: August 25th, 2021, 3:51 am

Re: Dynamic UpdateDivider!?

Post by JRaynor »

Yincognito wrote: August 25th, 2021, 10:35 am Dynamically changing the update divider is possible, and it can seriously reduce the CPU usage, if the skin / meters are large or the measures are CPU intensive. Don't know if it's suitable for this skin or how the changes would affect the other things in the skin though.

I can only confirm that it works, and the benefit is proportional with the original amount of CPU usage ... and this is true for high end systems as well.

EDIT: On a closer look, you might want to set the update divider to something like 1000 and such, instead of -1, so that the IfCondition can run again, irrespective if whether the RMS is 0 or not. That being said, AudioLevel measures will still take some CPU either way, that's just the way they operate.

P.S. An update of 50 ms is fine for a visualizer - mine is set to the same value. It brings a bit of slow-motion to the visual part, but it's just enough to slightly reduce the CPU usage while keeping the visualizer effect acceptable.
Looks like you're right about the AudioLevel plugin...
I tested the same skin without the AudioLevel plugin and the CPU consumption was less than 1% and with the plugin the CPU usage was around 3%.

I'm trying to optimize CPU and Memory usage as much as possible but I don't think I can use AudioLevel plugin the way I would like.
My goal is to keep CPU usage at 1% or less.
Anyway, I'll keep trying...
Thanks!
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

Re: Dynamic UpdateDivider!?

Post by death.crafter »

JRaynor wrote: August 26th, 2021, 5:18 am Looks like you're right about the AudioLevel plugin...
I tested the same skin without the AudioLevel plugin and the CPU consumption was less than 1% and with the plugin the CPU usage was around 3%.

I'm trying to optimize CPU and Memory usage as much as possible but I don't think I can use AudioLevel plugin the way I would like.
My goal is to keep CPU usage at 1% or less.
Anyway, I'll keep trying...
Thanks!
The approach you are using, you'll just end up using using more resources, given there are two audio level measures. The best thing you can do is leave it as is or use audio analyzer and use only one shape meter to draw the visualizer. But still, depending on what hardware you have it will have different resource usage. For my i3 it is about 7 to 9 percent. For ryzen 5, it is like 2% or so.
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Dynamic UpdateDivider!?

Post by Yincognito »

JRaynor wrote: August 26th, 2021, 5:18 amI tested the same skin without the AudioLevel plugin and the CPU consumption was less than 1% and with the plugin the CPU usage was around 3%.
My goal is to keep CPU usage at 1% or less.
Anyway, I'll keep trying...
Thanks!
Precisely my case, regarding the CPU usage and the goal, LOL - the only difference is that for me it's an entire suite of skins. They take less than 1% without the AudioLevel skin, and jump up to around double that amount on average, when idle, when the AudioLevel skin is loaded as well. And believe me, I TRIED to squeeze the most out of it, but that's the best I can get. Not a problem though, as I regularly use about half of the skins in my suite, and the more "CPU intensive" of them don't belong to that group (I still use Winamp, so the visualizer thing was never something I need, I only wrote it to have the full array of skin types in the suite).
death.crafter wrote: August 26th, 2021, 6:14 amThe approach you are using, you'll just end up using using more resources, given there are two audio level measures.
Although he's using more AudioLevel child measures, he's only using one AudioLevel parent measure. It's the amount of parent measures that matter and have a performance impact, as children are just functions of the parent, just like for WebParsers.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

Re: Dynamic UpdateDivider!?

Post by death.crafter »

Actually I noticed that AudioLevel doesn't take resources at all. It's the meters. The example in the docs doesn't even cross 0 lmao.

So as you said,, it's the meter's complicity. Ofc the number of measures matter but most of it is the meter.
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Dynamic UpdateDivider!?

Post by Yincognito »

death.crafter wrote: August 26th, 2021, 10:10 amActually I noticed that AudioLevel doesn't take resources at all. So as you said,, it's the meter's complicity.
Don't know what to say about the measures not taking resources at all (maybe they do, but the impact is so small that it's noticeable only when meters are involved), but yeah, all these factors are cumulative, and, after image resizing, the redrawing process (which does involve the meters, of course) is the most expensive one, especially when it's so often done, like in visualizers.
death.crafter wrote: August 26th, 2021, 10:10 amThe example in the docs doesn't even cross 0 lmao.
That's why it's an example in the docs, LOL - take a look at how every option is adjusted to "safe" values, from a performance POV. Like they say, life always beats the movies... :D

Yeah, an AudioLevel skin by itself is just like any other skin, and the impact can be insignificant. Put it in a more comprehensive environment though and its impact will be noticeable. It also depends on how good the code is, of course.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Dynamic UpdateDivider!?

Post by CodeCode »

visualisers will ALWAYS eat performance - in every variety save for the most simple and basic, like a 2 channel VU meter, cpu usage will be large.

Also, in regards to the original post, the update rate in the [Rainmeter] section is not going to EVER be dynamic. It is just not designed that way. UpdateDivider is the only way. Sorry if that was said already, i did not read the whole of all the posts. I just noticed this thread was accumulating pages on a subject that actually is very basic, since rainmeter has very set ways of managing updates.
Post Reply