It is currently October 24th, 2021, 9:22 am

[Solved] Meters and measure hidden/disabled still consuming CPU

Help with creating, editing & fixing problems with skins
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by Duschmoll »

death.crafter wrote: September 13th, 2021, 2:20 pm Can you give a rough note on how much they consume and how much you expect them to consume?
It's around 0.8 to 1.2% of my CPU when all the meters and measures are activated. (I got an old CPU i5-4690)
When I set that all the meters and measures to "off" I'm hoping for it to be at none. It's actually at 0.6 to 0.9%.
Because, no meters or measures are supposed to be showed or updated, so I don't understand why it's still consuming CPU usage.

Maybe it's simply not possible.
User avatar
death.crafter
Posts: 1064
Joined: April 24th, 2021, 8:13 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by death.crafter »

Duschmoll wrote: September 13th, 2021, 2:08 pm

Code: Select all

IfTrueAction=[!HideMeterGroup "Audio"][!SetOptionGroup Audio UpdateDivider "-1"][!SetOptionGroup Audio DynamicVariables "0"][!DisableMeasureGroup Audio]
Have some faith!

If you disable a meter, it stops updating. No ifs or buts.

Code: Select all

IfTrueAction=[!HideMeterGroup Audio][!DisableMeasureGroup Audio]
IfFalseAction=[!ShowMeterGroup Audio][!EnableMeasureGroup Audio]
This will work more than fine.
from the Realm of Death
My Current Desktop
User avatar
jsmorley
Developer
Posts: 22374
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Meters and measure hiding/disabled still consuming CPU

Post by jsmorley »

death.crafter wrote: September 13th, 2021, 2:27 pm Have some faith!

If you disable a meter, it stops updating. No ifs or buts.

Code: Select all

IfTrueAction=[!HideMeterGroup Audio][!DisableMeasureGroup Audio]
IfFalseAction=[!ShowMeterGroup Audio][!EnableMeasureGroup Audio]
This will work more than fine.
Do remember that the real work that meters do is not done in the meter itself, but in the "redraw" function of the Update cycle, when they are "built" and "drawn". That can only be impacted by the Update value in [Rainmeter]. Measures can be "disabled", and that will have an impact on CPU usage. Meters, not so much. They do almost no real "work" when they are updated anyway. They more or less just go get the current value for any MeasureName options on them, and resolve any dynamic variables or section variables. The real work is during "redraw".

That is why
LeftMouseUpAction=[!UpdateMeter MyMeter]
does pretty much nothing. It needs to be
LeftMouseUpAction=[!UpdateMeter MyMeter][!Redraw]
in order to effect a change "now".
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by Duschmoll »

death.crafter wrote: September 13th, 2021, 2:27 pm Have some faith!

If you disable a meter, it stops updating. No ifs or buts.

Code: Select all

IfTrueAction=[!HideMeterGroup Audio][!DisableMeasureGroup Audio]
IfFalseAction=[!ShowMeterGroup Audio][!EnableMeasureGroup Audio]
This will work more than fine.
Thanks you for giving me hope :D

But even using this it still around 0.4 to 0.8%, an improvement !
Is there a way to know what is updating on the skin live ? Maybe I'm missing something, and that what's still updating in the background.
I have double-check and all my meters/measures are in a group for them to be disabled.
I've added the skin updated with the lasted input you gave me, if you don't mind to check it out
I can be on discord to maybe explain myself better
Last edited by Duschmoll on September 13th, 2021, 2:49 pm, edited 2 times in total.
User avatar
death.crafter
Posts: 1064
Joined: April 24th, 2021, 8:13 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by death.crafter »

jsmorley wrote: September 13th, 2021, 2:31 pm Do remember that the real work that meters do is not done in the meter itself, but in the "redraw" function of the Update cycle, when they are "built" and "drawn". That can only be impacted by the Update value in [Rainmeter].
Well, I guess then hidden meters are drawn too?? I don't think so, but asking considering what the OP has to said.
Duschmoll wrote: September 13th, 2021, 2:25 pm
Okay, a little bit sussy.

Your skin consumes CPU even if Update is set to -1.

@jsmorley, is it because his skin contains images? Cause my other skin with Update=-1 sticks to 0.
from the Realm of Death
My Current Desktop
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by Duschmoll »

jsmorley wrote: September 13th, 2021, 2:31 pm Do remember that the real work that meters do is not done in the meter itself, but in the "redraw" function of the Update cycle, when they are "built" and "drawn". That can only be impacted by the Update value in [Rainmeter]. Measures can be "disabled", and that will have an impact on CPU usage. Meters, not so much. They do almost no real "work" when they are updated anyway. They more or less just go get the current value for any MeasureName options on them, and resolve any dynamic variables or section variables. The real work is during "redraw".

That is why
LeftMouseUpAction=[!UpdateMeter MyMeter]
does pretty much nothing. It needs to be
LeftMouseUpAction=[!UpdateMeter MyMeter][!Redraw]
in order to effect a change "now".
I'm guessing I don't need the redraw because the way I setup my "disable" function, you need to refresh the skin to make it work.
death.crafter wrote: September 13th, 2021, 2:43 pm
Okay, a little bit sussy.

Your skin consumes CPU even if Update is set to -1.

@jsmorley, is it because his skin contains images? Cause my other skin with Update=-1 sticks to 0.
Ah, that seem sus indeed haha
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hidden/disabled still consuming CPU

Post by Duschmoll »

After some testing and separing each one of my parts of the skin that I want to try and puting a Update:-1 in the rainmeter section, I have found the culprit !

It's coming from a plugin, UsageMonitor :twisted:
I use it 4 times. Here are the measures that use it in my skin:

Code: Select all

	[MeasureWritingSpeedDrive]
        Measure=Plugin
        Plugin=UsageMonitor
        Alias=IOWRITE
        Category=Process
        Counter=IO Write Bytes/sec
        Group=Drive

        [MeasureReadingSpeedDrive]
        Measure=Plugin
        Plugin=UsageMonitor
        Alias=IOREAD
        Category=Process
        Counter=IO Read Bytes/sec
        Group=Drive
        
        [MeasureTopCPU]
        Measure=Plugin
        Plugin=UsageMonitor
        Alias=CPU
        Index=1
        Blacklist=_Total|Idle|dwm
        UpdateDivider=5
        Group=CPU
        
        [MeasureGPUTop]
        Measure=Plugin
        Plugin=UsageMonitor
        Alias=GPU
        Index=1
        Blacklist=_Total|Idle|dwm
        UpdateDivider=5
        Group=GPU
They doesn't seem to care about the update rate of rainmeter. :p
When I remove thoses measures, rainmeter actually doesn't use any CPU.

I'm putting a skin with each section separated if you want to test this out. They are in Drive, CPU and GPU variants.
Now the difficult part will be to know if there is a way to stop them haha
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22374
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Meters and measure hiding/disabled still consuming CPU

Post by jsmorley »

death.crafter wrote: September 13th, 2021, 2:43 pm Well, I guess then hidden meters are drawn too?? I don't think so, but asking considering what the OP has to said.



Okay, a little bit sussy.

Your skin consumes CPU even if Update is set to -1.

@jsmorley, is it because his skin contains images? Cause my other skin with Update=-1 sticks to 0.
Just to clarify:

1) Meters that are "hidden" are not "drawn" during the redraw cycle of the skin. So hiding a meter will in fact reduce the amount of resources used.

2) Meters that are set to UpdateDivider=-1 are still "drawn" during the redraw function. So while they are not "updated" to get the latest values for MeasureName and dynamic variables and section variables, they still take resources. To be honest, I don't see much value in UpdateDivider=-1 on meters. Measures, sure, meters, not so much.

3) The redraw functionality is part of the overall skin "loop", that is entirely and only controlled by the value of Update in [Rainmeter]. Update=-1 will eliminate the redraw, since it eliminates the entire "loop", and you would need to have some mouse action that forces updates and redraws only when you want/need them. Mouse actions are in effect "interrupt" driven, and do not depend on the Update cycle.

4) Images that are in any way "resized" by setting W and/or H on the meter are one of the most expensive things Rainmeter does. The bigger the "change" from the real size to the defined W and H setting, the more work it does. Nothing to get worried about, it's all pretty efficient overall, but if you have a lot of images and are resizing them in the meter, that can add up...
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hidden/disabled still consuming CPU

Post by Duschmoll »

@jsmorley Should I post the issue with the plugin in rainmeter bugs section of the forum ?
User avatar
jsmorley
Developer
Posts: 22374
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Meters and measure hidden/disabled still consuming CPU

Post by jsmorley »

Duschmoll wrote: September 14th, 2021, 10:42 am @jsmorley Should I post the issue with the plugin in rainmeter bugs section of the forum ?
Depends, I didn't follow what plugin is involved. If it is one of the built-in Rainmeter plugins, then yes. If it is a 3rd-party plugin, it's best to post in some support thread for the plugin, or contact the author directly.