It is currently April 28th, 2024, 5:58 am

Question about CPU Utilization with UpdateDivider & Net

Get help with creating, editing & fixing problems with skins
Neema
Posts: 5
Joined: November 7th, 2012, 12:15 pm

Question about CPU Utilization with UpdateDivider & Net

Post by Neema »

In a skin, if I set Update=1000 and UpdateDivider=1 (or exclude it entirely) and measure Net In and Out, CPU utilization for me is low. If I set Update=20 and UpdateDivider=500 in a skin, technically the same update interval as in the previous example, each Net In and Net Out measure utilizes an increase of about 1.5% of total CPU, each, by the Rainmeter application.

Does this make sense?
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Question about CPU Utilization with UpdateDivider & Net

Post by moshi »

you are aware that Update=20 affects every single Meter and Measure in the skin?
Neema
Posts: 5
Joined: November 7th, 2012, 12:15 pm

Re: Question about CPU Utilization with UpdateDivider & Net

Post by Neema »

According to the Rainmeter documentation:
Individual meters and measures can be made to update more slowly by "skipping" cycles, using the UpdateDivider option. In addition, the !Update bang forces the skin to update immediately, resetting the timed cycle.
UpdateDivider Default: 1
Frequency at which the measure value is updated. If set to -1, the measure will be updated only once on load or on refresh. Otherwise, the global Update option is multiplied by the specified value to determine the update frequency.

Example: If Update=1000 (in the [Rainmeter] section) and UpdateDivider=30, the measure is updated every 30 seconds.
UpdatedDivider is supposed to counteract that behavior for each meter and measure it is used in. Or is this no longer the case? If this is no longer the case, the documentation needs to be updated/clarified.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Question about CPU Utilization with UpdateDivider & Net

Post by jsmorley »

Neema wrote:According to the Rainmeter documentation:
UpdatedDivider is supposed to counteract that behavior for each meter and measure it is used in. Or is this no longer the case? If this is no longer the case, the documentation needs to be updated/clarified.
Nothing has changed as far as how Update and UpdateDivider work.

http://docs.rainmeter.net/tips/update-guide
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Question about CPU Utilization with UpdateDivider & Net

Post by Kaelri »

With Update=20 and UpdateDivider=500, even though the measures are not actually updating, Rainmeter still has to check each measure on each update, essentially to see if the measure is "ready." This is obviously a minor process (basically just comparing two numbers), but when it's trying to do that 500 times per second for each meter and measure, it starts to add up. More importantly, though, even without updating any meters or measures, the skin's update cycle always includes a redraw of the skin's graphics, which takes (in programming terms) a substantial amount of power.

In short, when you set a very high Update speed on a skin, you're adding a lot of "overhead," which no amount of UpdateDividers can completely compensate for.
Neema
Posts: 5
Joined: November 7th, 2012, 12:15 pm

Re: Question about CPU Utilization with UpdateDivider & Net

Post by Neema »

Kaelri wrote:With Update=20 and UpdateDivider=500, even though the measures are not actually updating, Rainmeter still has to check each measure on each update, essentially to see if the measure is "ready." This is obviously a minor process (basically just comparing two numbers), but when it's trying to do that 500 times per second for each meter and measure, it starts to add up. More importantly, though, even without updating any meters or measures, the skin's update cycle always includes a redraw of the skin's graphics, which takes (in programming terms) a substantial amount of power.

In short, when you set a very high Update speed on a skin, you're adding a lot of "overhead," which no amount of UpdateDividers can completely compensate for.
Thank you for that explanation, it is very helpful.

My only problem is that when using measures, other than the Net measures, the CPU utilization barely increases (from 0.02 to 0.1% approx), but the Net measures have a large jump in CPU utilization (from 1 to 1.5% approx) in comparison, when using an Update of 20 and UpdateDivider of 500.

I just don't understand why it is the case just for the Net measures.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Question about CPU Utilization with UpdateDivider & Net

Post by Kaelri »

Could you provide the skin you're using to demonstrate this behavior? I'm not aware of any reason why the Net measures would be different, and I'd like to rule out any other factors in your skin.
Neema
Posts: 5
Joined: November 7th, 2012, 12:15 pm

Re: Question about CPU Utilization with UpdateDivider & Net

Post by Neema »

I sure can, and thank you for taking the time to look into this.

Here is the skin with the Net references and another skin without Net reference that I have compared the CPU utilization against.

If you need the skins with all files included, please let me know, I can add an attachment.

Skin with Net:

Code: Select all

[Rainmeter]
BackgroundMode=1
Update=20

[Metadata]
Name=CircleNet
Author=Neema-Designs | xxxxxxxxxxxx.xxxxxxxxxxxxxxx.com
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

@Include=#@#Settings\Color.inc
@Include2=#@#Settings\General.inc

[Variables]
UpDiv=50

[Transition]
Measure=Script
ScriptFile=#@#Scripts\Transition.lua

[Background]
Meter=IMAGE
ImageName=circle_bkga.png
Path="#@#Images"
W=128
H=128
ImageAlpha=#ImageAlpha#
MouseOverAction=!CommandMeasure Transition "FadeToggle('Background', 175, 255)"
MouseLeaveAction=!CommandMeasure Transition "FadeIn('Background')"
MiddleMouseUpAction=!Execute [control.exe ncpa.cpl]
UpdateDivider=#UpDiv#

[NetTitle]
Meter=STRING
X=64
Y=78
FontFace=moderna
FontSize=32
FontColor=#TitleColor#
StringAlign=CenterCenter
AntiAlias=1
Text="Net"
UpdateDivider=#UpDiv#

[MeasureNetIn]
Measure=NetIn
UpdateDivider=#UpDiv#

[NetInText]
Meter=STRING
X=43
Y=28
FontFace=moderna
FontSize=10
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text="In"
UpdateDivider=#UpDiv#

[NetInBar]
Meter=BAR
MeasureName=MeasureNetIn
X=5r
Y=18r
Flip=0
BarColor=#BarNetColor#
W=3
H=50
BarOrientation=Vertical
SolidColor=#BarBGColor#
UpdateDivider=#UpDiv#

[MeasureNetOut]
Measure=NetOut
UpdateDivider=#UpDiv#

[NetOutText]
Meter=STRING
X=15r
Y=-18r
FontFace=moderna
FontSize=10
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text="Out"
UpdateDivider=#UpDiv#

[NetOutBar]
Meter=BAR
MeasureName=MeasureNetOut
X=14r
Y=18r
Flip=0
BarColor=#BarNetColor#
W=3
H=50
BarOrientation=Vertical
SolidColor=#BarBGColor#
UpdateDivider=#UpDiv#

[NetIn]
Meter=STRING
MeasureName=MeasureNetIn
X=36
Y=47
Postfix="B"
FontFace=moderna
FontSize=8
FontColor=#FontColor#
StringAlign=Right
Angle=#RotateVert#
AntiAlias=1
AutoScale=1
UpdateDivider=#UpDiv#

[NetOut]
Meter=STRING
MeasureName=MeasureNetOut
X=80
Y=r
Postfix="B"
FontFace=moderna
FontSize=8
FontColor=#FontColor#
StringAlign=Right
Angle=#RotateVert#
AntiAlias=1
AutoScale=1
UpdateDivider=#UpDiv#
Skin without Net references:

Code: Select all

[Rainmeter]
BackgroundMode=1
Update=20

[Metadata]
Name=CircleCPU
Author=Neema-Designs | xxxxxxxxxxxx.xxxxxxxxxxxxxxx.com
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

@Include=#@#Settings\Color.inc
@Include2=#@#Settings\General.inc

[Variables]
UpDiv=50

[Transition]
Measure=Script
ScriptFile=#@#Scripts\Transition.lua

[Background]
Meter=IMAGE
ImageName=circle_bkga.png
Path="#@#Images"
W=128
H=128
ImageAlpha=#ImageAlpha#
MouseOverAction=!CommandMeasure Transition "FadeToggle('Background', 175, 255)"
MouseLeaveAction=!CommandMeasure Transition "FadeIn('Background')"
MiddleMouseUpAction=!Execute [%windir%\System32\resmon.exe]
UpdateDivider=#UpDiv#

[MeasureCPU]
Measure=CPU
Processor=0
UpdateDivider=#UpDiv#

[CPUTitle]
Meter=STRING
X=64
Y=78
FontFace=moderna
FontSize=32
FontColor=#TitleColor#
StringAlign=CenterCenter
AntiAlias=1
Text="CPU"
UpdateDivider=#UpDiv#

[CPUOut]
Meter=STRING
MeasureName=MeasureCPU
X=92
Y=93
FontFace=moderna
FontSize=12
FontColor=#FontColor#
StringAlign=RIGHT
AntiAlias=1
Text="%1%"
Percentual=1
UpdateDivider=#UpDiv#

[MeasureCPU1]
Measure=CPU
Processor=1
UpdateDivider=#UpDiv#

[CPU1Text]
Meter=STRING
X=36
Y=26
FontFace=moderna
FontSize=9
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text="1"
UpdateDivider=#UpDiv#

[CPU1Bar]
Meter=BAR
MeasureName=MeasureCPU1
X=4r
Y=16r
Flip=0
BarColor=#BarCPUColor#
W=3
H=50
BarOrientation=Vertical
SolidColor=#BarBGColor#
UpdateDivider=#UpDiv#

[MeasureCPU2]
Measure=CPU
Processor=2
UpdateDivider=#UpDiv#

[CPU2Text]
Meter=STRING
X=11r
Y=-16r
FontFace=moderna
FontSize=9
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text="2"
UpdateDivider=#UpDiv#

[CPU2Bar]
Meter=BAR
MeasureName=MeasureCPU2
X=4r
Y=16r
Flip=0
BarColor=#BarCPUColor#
W=3
H=50
BarOrientation=Vertical
SolidColor=#BarBGColor#
UpdateDivider=#UpDiv#

[MeasureCPU3]
Measure=CPU
Processor=3
UpdateDivider=#UpDiv#

[CPU3Text]
Meter=STRING
X=11r
Y=-16r
FontFace=moderna
FontSize=9
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text="3"
UpdateDivider=#UpDiv#

[CPU3Bar]
Meter=BAR
MeasureName=MeasureCPU3
X=4r
Y=16r
Flip=0
BarColor=#BarCPUColor#
W=3
H=50
BarOrientation=Vertical
SolidColor=#BarBGColor#
UpdateDivider=#UpDiv#

[MeasureCPU4]
Measure=CPU
Processor=4
UpdateDivider=#UpDiv#

[CPU4Text]
Meter=STRING
X=11r
Y=-16r
FontFace=moderna
FontSize=9
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text="4"
W=128
H=128
UpdateDivider=#UpDiv#

[CPU4Bar]
Meter=BAR
MeasureName=MeasureCPU4
X=4r
Y=16r
Flip=0
BarColor=#BarCPUColor#
W=3
H=50
BarOrientation=Vertical
SolidColor=#BarBGColor#
UpdateDivider=#UpDiv#